The SiOC ceramic was prepared with vinyltriethoxysilane as the sol−gel precursor, and followed by etching with KOH. The effect of KOH etching on the morphology, structure and electrochemical properties of SiOC anodes was investigated. The amorphous SiOC ceramics with different free carbon content is obtained by KOH etching. The reaction of oxygen-enriched units with KOH and the activation of free carbon resulted in the formation of micro and mesopores. The galvanostatic charging/discharging and rate capability suggest that the electrochemical performance of SiOC ceramics is improved by KOH etching. As compared with SiOC sample, KOH-SiOC-5 (KOH/SiOC weight ratio of 5:1) with a high BET surface area of 249.2m2 g−1 deliveres a discharge capacity of 607mAhg−1 at the current density of 36mAg−1. Nano-sized pores, mixed SiOxC4-x structures and the free carbon phase both work together for the excellent electrochemical performance. The contribution of carbon to reversible capacity is higher than that of SiOxC4-x phases and surface area. However, the specific surface area, pore volume and free carbon content are decreased by excessive etching with KOH, which resulted in the decrease of electrochemical properties.