Effects of monovalent and divalent counterions on the acid-base equilibrium of a pH-sensitive merocyanine dye covalently attached to copolymers of acrylic acid and acrylamide with varying charge densities (0.28 < xi < 2.8) were investigated. Added chloride salts of Li+, Na+, K+, and NH4+ (< 0.2 mM) had essentially no effect on pK observed (pK(obs)) for the equilibrium. By contrast, the salts of Mg2+, Ca2+, Sr2+, and Ba2+ caused a significant decrease in pK(obs) for the copolymers with larger xi. With smaller xi, most likely when xi < 0.5, no decrease in pK(obs) was observed upon addition of the salts of divalent cations. A competitive effect of Ca2+ and Na+ ions on pK(obs) in the presence of an excess of Na+ ions implied that Ca2+ ions at very low concentrations were preferentially, and therefore exhaustively, condensed on the polyanions with sufficiently large xi probably until effective charge density was lowered to 0.5. The observed difference in the influence of the monovalent and divalent cations on pK(obs) was discussed in terms of the difference in the microscopic behavior of the condensed monovalent and divalent cations.