We report a polarizing beam splitter that uses binary phase gratings written onto a liquid-crystal spatial light modulator. These gratings produce several linearly polarized diffracted orders and a zeroth-order beam whose polarization state can be completely controlled. Experimental results are shown.