SiOC and SiCaMgOC coatings were prepared by sol–gel method from precursors of hydrosilane and the mixture of hydrosilane, calcium acetylacetonate (Ca(acac)2) and magnesium acetylacetonate (Mg(acac)2), respectively. Fourier transform infra-red (FTIR) and X-ray photoelectron spectroscopy (XPS) analysis on the coatings revealed that Ca2+and Mg2+ ions can be successfully doped into SiOC coating after aging and annealing in the SiCaMgOC coating. The cytotoxicity and bioactivity of three samples have been detected by MTT assay, cell adhesion and simulated boy fluid (SBF) immersion test. The results suggested that SiCaMgOC coating induced more apatite than that of C/C and SiOC in the comparable soaking process. SiCaMgOC coating demonstrated better biological activity and cellular adherence for its higher surface roughness and ion exchange reaction between Ca2+and Mg2+ ions and protons (H+/H3O+) in the SBF solution.