Two-photon confocal microscopy and back extraction with UV/Vis-absorption spectrophotometry quantify equilibrium partition coefficients, k, for six prototypical drugs in five soft-contact-lens-material hydrogels over a range of water contents from 40 to 92%. Partition coefficients were obtained for acetazolamide, caffeine, hydrocortisone, Oregon Green 488, sodium fluorescein, and theophylline in 2-hydroxyethyl methacrylate/methacrylic acid (HEMA/MAA, pKa≈5.2) copolymer hydrogels as functions of composition, aqueous pH (2 and 7.4), and salinity. At pH 2, the hydrogels are nonionic, whereas at pH 7.4, hydrogels are anionic due to MAA ionization. Solute adsorption on and nonspecific electrostatic interaction with the polymer matrix are pronounced. To express deviation from ideal partitioning, we define an enhancement or exclusion factor, E ≡ k/ϕ1, where ϕ1 is hydrogel water volume fraction. All solutes exhibit E > 1 in 100 wt % HEMA hydrogels owing to strong specific adsorption to HEMA strands. For all solutes, E significantly decreases upon incorporation of anionic MAA into the hydrogel due to lack of adsorption onto charged MAA moieties. For dianionic sodium fluorescein and Oregon Green 488, and partially ionized monoanionic acetazolamide at pH 7.4, however, the decrease in E is more severe than that for similar-sized nonionic solutes. Conversely, at pH 2, E generally increases with addition of the nonionic MAA copolymer due to strong preferential adsorption to the uncharged carboxylic-acid group of MAA. For all cases, we quantitatively predict enhancement factors for the six drugs using only independently obtained parameters. In dilute solution for solute i, Ei is conveniently expressed as a product of individual enhancement factors for size exclusion (Eiex), electrostatic interaction (Eiel), and specific adsorption (Eiad):Ei≡EiexEielEiad. To obtain the individual enhancement factors, we employ an extended Ogston mesh-size distribution for Eiex; Donnan equilibrium for Eiel; and Henry's law characterizing specific adsorption to the polymer chains for Eiad. Predicted enhancement factors are in excellent agreement with experiment.