A phase-inversion technique is introduced to produce a porous Sn anode for sodium batteries, which can accommodate volume changes during sodiation and desodiation. The Sn electrode shows two plateaus with a capacity of 1066 mAh g−1 during the first sodiation and four flat plateaus with a charge capacity of 674 mAh g−1 at the first desodiation process. During 500 cycles, the Sn electrode shows reversible capacity more than 519 mAh g−1 with Coulombic efficiency of nearly 99%. The Sn electrode with a porous structure is a possible solution to the electrode degradation.