Phosphorus NMR can measure myocardial tissue pH from the chemical shift of inorganic phosphate (Pi) in isolated buffer-perfused hearts, but in vivo the Pi peak originating from the myocardium is obscured by the resonance of 2,3-diphosphoglycerate (DPG) in the blood, making pH difficult to determine. Taking advantage of the fact that most of the interfering DPG is within the cardiac chambers and is rapidly flowing out of the sensitive volume of our coil, we developed a pulse sequence which would separate myocardial Pi signal from interfering DPG. We tested this method on a flow phantom and in living rat heart, using exogenous glycerol phosphate as a blood-pool marker. The results indicated that signal from moving and nonmoving substances could be separated, and derived values for myocardial pH and PCr/Pi ratio were consistent with previous estimates. This method should be useful for studying myocardial acid-base physiology with NMR.