The interaction of Na+, Ca2+, Mg2+, Zn2+ and La3+ with heparin, a highly negatively charged glycosaminoglycan, was studied by H-1 and Na-23 nuclear magnetic resonance spectroscopy. H-1 chemical shift and nuclear Overhauser effect (NOE) data indicate that the counter ions Na+, Ca2+ and Mg2+ interact with the low pH, carboxylic acid form of heparin by delocalized, long-range electrostatic interactions. At higher pH, H-1 chemical shift and NOE data indicate that Na+ and Mg2+ continue to interact with heparin in the same manner, even upon deprotonation of the carboxylic acid group; however, then is a site-specific contribution to the binding of Ca2+, Zn2+ and La3+ under these conditions. Acid dissociation constants for heparin carboxylic acid groups and heparin-metal binding constants were determined from the pH dependence of H-1 chemical shifts and Na-23 spin-lattice (T-1) relaxation times. Equilibrium constants for exchange of M(2+) for heparin-bound Na+ were obtained from Na-23 T-1 data. The acid dissociation constants show a strong dependence on Na+ concentration due to the polyelectrolyte character of heparin.