The equilibrium between the alpha and beta-anomers of D-glucopyranose in aqueous solution has been investigated by free energy simulations that permit a separation of the intramolecular and intermolecular contributions to the free energy difference. The simulations correctly predict that the free energy difference between the two forms in aqueous solution is small; the calculated free energy difference, DELTA-G(beta --> alpha), is -0.31 +/- 0.43 kcal/mol, in comparison with the experimental value of 0.33 kcal/mol. The calculated free energy difference is the result of near cancelation of two larger, statistically significant contributions, i.e., an intramolecular electrostatic term favoring the alpha-anomer and an intermolecular solute-solvent interaction term favoring the beta-anomer. This result supports the conjecture that solvation stabilizes the beta-anomer in water. There is a large difference in the intramolecular contribution to the anomeric equilibrium calculated in solution from the free energy simulation and the gas-phase minimum; this suggests that conformational averaging, modulated by the solvent, is significant even for the internal terms. An examination of the rotamer distribution in the hydroxymethyl side chain shows that the trans, gauche conformer is strongly disfavored in aqueous solution, in accord with experiment.