We show that arbitrary RF phase shifts can be measured precisely using the nuclear spins to monitor the phase of the RF field. Other imperfections like resonance offset, RF inhomogeneity, or symmetric phase transients are removed by the action of the multiple-pulse sequence and have little influence on the measurements. Phase shifts can be trimmed to the desired value with an uncertainty of less than 10 millidegrees in favorable cases.