Reliable application of spatial light modulators (SLMs) as programmable diffractive optical elements requires a thorough calibration. In this paper, we propose a method for calibrating SLMs based on the evaluation of Fresnel images. Fresnel images generated by a binary phase diffraction grating consist of binary irradiance distributions whose visibility depends on the phase modulation. By displaying on our device a diffraction grating with a binary phase step along one direction and a linearly increasing phase along the orthogonal direction, we perform a complete phase calibration. In this way, the phase modulation for every pixel and for every value of the entrance signal can be determined experimentally.Additionally, data acquisition can be significantly simplified with this scheme.