The adsorption of formic acid and sodium formate on the stoichiometric anatase (101) surface has been studied by means of density functional calculations with a slab geometry. On the clean surface, the most stable adsorption structure for HCOOH is a molecular monodentate configuration, hydrogen bonded to a surface bridging oxygen, while for HCOONa a dissociated bridging bidentate geometry is preferred. The bidentate chelating structure is energetically unstable for both the acid and the salt. On the hydrated surface, both HCOOH and HCOONa preferentially form an inner-sphere adsorption complex. HCOOH maintains a monodentate coordination, but, due to the interaction with a nearby water molecule, it becomes dissociated, while HCOONa again prefers a bridging bidentate structure. The energies for adsorption from an aqueous solution are estimated to be 0.30 and 0.79 eV for HCOOH and HCOONa, respectively.