Tin phosphates with various mesopore ratios are synthesized with surfactants as templates. The mesopore ratios of the tin phosphates are controlled by adjusting the surfactant: inorganic precursor ratios. As an anode material for Li-ion batteries, the mesoporous and non-mesoporous mixture with a high mesopore ratio exhibits enhanced cycling stability. Compared with the ∼34% (∼135mAhg−1) capacity retention after 50 cycles of the non-mesoporous tin phosphate (between 2.5 and 0.001V), the tin-phosphate anodes with mesopore ratios of 42, 82 and 100% show capacity retentions that are enhanced by more than 50%, showing charge capacities of ∼260, ∼290, and ∼325mAhg−1, respectively (after 50 cycles). The mesoporous structures may alleviate the large volume change of the Sn nanoparticles embedded in the lithium-phosphate matrix during charge–discharge. Cycling tests of the 100% mesoporous tin phosphate between 0.8 and 0.001V exhibit no capacity decay: ∼325mAhg−1 remains after 50 cycles. This is probably because re-oxidation of metallic tin with lithium-phosphate matrix does not occur.