We present a new method to analyze quantitatively the wave front of a partially coherent x-ray beam. The technique is based on the use of two-dimensional speckle patterns combined with digital image correlation algorithms and offers a pixel size resolution, a high accuracy, and a reduced sensitivity to mechanical vibrations thanks to a very simple setup. The requirements on transverse and longitudinal coherence are also low. Finally, we show how the method can be used for phase contrast imaging applications by a single sample exposure process.