Uniform mesocrystals of TiO2 (anatase) have been prepared from mesocrystals of NH4TiOF3. NH4TiOF3 was synthesized from an aqueous solution containing (NH4)2TiF6 and H3BO3 in the presence of a nonionic surfactant Brij 56, Brij 58, or Brij 700, at low temperatures. The exterior shapes of NH4TiOF3 mesocrystals can be tuned by adjusting the reagent concentration, reaction time, reaction temperature, and rate of stirring. The formation of the NH4TiOF3 mesocrystals proceeds via a self-assembly process involving nonclassical crystal growth. By sintering in air at 450 degrees C, or washing with H3BO3 solution at ambient temperatures, the NH4TiOF3 mesocrystals can be converted to mesocrystals of TiO2 (anatase), and the original architecture is retained.