3D porous carbon encapsulated SnO2 nanoparticles composite (SnO2-PC) prepared by an efficient in situ methodology was applied as anode for sodium ion batteries (SIBs). It delivered a high reversible specific capacity of 280.1mAhg−1 after 250 cycles at a current density of 100mAg−1, with ultrahigh capacity retention of 91.63%. Notably, it can Exhibit 100mAhg−1 after 1000 cycles even at a high current density of 1600mAg−1. These greatly enhanced electrochemical properties of SnO2-PC composite can be attributed to the superior structure that the electrical conductivity of the composite was improved by the porous carbon matrix, moreover, it can serve as a cushion during the process of Na ion insertion/extraction into the composite. Significantly, this kind of in situ synthesis method is portable for other similar composite.