The binding of solution-borne ligands is a ubiquitous biological mechanism regulating the folding of proteins and nucleic acids into specific, functional structures. Obtaining the parameters of these regulatory processes requires precision measurement techniques that quantify both ligand number and biomolecular structure. We demonstrated this approach in a model experimental system: we quantified the release of counterions (the ligands) when a DNA hairpin (the biomolecule) unfolds. We did this by measuring two-state length fluctuations of the hairpin as a function of both stabilizing salt concentration and destabilizing force. Since changes in DNA structure are directly linked to changes in the ionic composition of the surrounding atmosphere, we used these data to establish three ion counting procedures. Contrary to assumptions of widely used nucleic acid stability models, we found that the number of ions released upon unfolding the hairpin is a nonmonotonic function of the bulk concentration of salt in solution, demonstrating the sensitivity to resolve free-energy contributions with this approach. The methods can be applied to any biomolecule/ligand interaction so long as the equilibrium dynamics of the system are experimentally accessible.