A level sensor for a lithographic projection apparatus includes a light
source configured to direct light onto a substrate to be measured, a
detector configured to detect light reflected from the substrate, and a
processor configured to calculate a difference between measurements made
with the filter in the first configuration and in the second
configuration. The sensor is adjustable between a first configuration, in
which the light is given a first property, and a second configuration, in
which the light is given a second property. The sensor may include a
polarizing filter, such that the first and second properties are
different polarization states.