Porous silicon carbonitride (SiCN) ceramics were pyrolyzed from poly(silylcarbondiimide) derivatives, followed by etching with different concentrations of HF aqueous solution (5, 10, 15 and 20 wt%). The morphologies, structures and electrochemical performances of the HF-etched SiCN materials were investigated. The results indicated that the surface of the HF-etched SiCN composites became rough and porous. SiCN-10-HF, one of four HF-etched SiCN samples, showed excellent electrochemical properties as an anode for lithium ion batteries. Charge–discharge measurements indicated that the SiCN-10-HF anode exhibited a high initial specific discharge capacity of 681 mA h g−1 at a current density of 40 mA g−1, which was 2.4 times that of the unetched SiCN anode. After 100 cycles, the discharge capacity of SiCN-10-HF anode delivered 229.3 mA h g−1, which was 5.0 times that of the unetched SiCN anode (45.6 mA h g−1). Additionally, the SiCN-10-HF anode exhibited high rate performance. At a current density of 190 mA g−1, the discharge capacity of the anode was 160 mA h g−1. It was deduced that the formation of nano-sized pores or holes on the surface of the SiCN materials in the HF-etching process not only offered new channels for the intercalation of Li+ but also relieved the volume expansion during the charge and discharge process, resulting in improved capacity, stable cycling and good rate capability.