B, F and N tri-doped carbon hollow spheres (BFNHCS) were prepared by a simple polymerization method, using polydopamine (PDA) as C and N sources and ionic liquid 1-butyl-3-methylimidazole tetrafluoroborate as B and F sources. The BFNHCS has large electrode/electrolyte interface, large interlayer spacing and good conductivity due to the heteroatoms doping and hollow structure. When using BFNHCS as the anode material for sodium ion batteries, it shows specific capacity of 255.6, 231.5, 197.4, 178.2, 157.8, 134.5 and 116.4 mAh g−1 at 0.1, 0.2, 0.5, 1.0, 2.0, 5.0 and 10.0 A g−1, respectively. It also exhibits an excellent sodium-storage capacity of 136.5 mAh g−1 after 1000 cycles at 5.0 A g−1.