Activities of Mg and Ca in solutions of heparin [a pharmacologically important anticoagulant] with added NaCl or KCl were determined by means of a previously described dye spectrophotometric method. The polyion concentration, Cp (expressed as mol univalent anionic charges/l) is 0.001 in all cases, solution total ionic strengths are 0.005, 0.0075, 0.01, 0.02 and 0.4 mol/l. Divalent metal ion concentrations are varied between 0-1.0 Cp. The results for the metal ion activities are expressed in the form of binding isotherms, .theta.2 vs. C2/Cp (.theta.2 = C2b/Cp; C2b = bound divalent metal ion concentration) and Scatchard plots, K2 vs. .theta.2/(C2-C2b), at different ionic strengths. Results are correlated with a theoretical treatment of the mixed counterion system, called the 2 variable theory, recently developed by Manning. The ionic strength dependence of .theta.2 and K2 agrees with the prediction of the 2 variable theory. Mg interaction with heparin appears to be independent of the nature of the changed groups on the polyion and is in very good agreement with the 2 variable theory. Ca binding was considerably higher than Mg binding and is in excess of theoretical predictions, suggesting a localized or specific interaction of Ca with heparin.