Rotational-echo double resonance (REDOR) is a magic-angle spinning technique for measuring heteronuclear dipolar couplings. Rotor-synchronized π pulses recouple the dipolar interaction. The accuracy of a REDOR determination of distance or orientation depends totally on the quality of the dephased (recoupled) and full-echo spectra. We present a scheme for measuring and compensating for the effects of pulse imperfections in REDOR experiments. No assumptions are made about the quality of the π pulses, and no pulses are added or taken away in implementing the compensation for incomplete REDOR dephasing by imperfect π pulses.