Ultra-high temperature ceramics are desirable for applications in the hypersonic vehicle, rockets, re-entry spacecraft and defence sectors, but few materials can currently satisfy the associated high temperature ablation requirements. Here we design and fabricate a carbide (Zr0.8Ti0.2C0.74B0.26) coating by reactive melt infiltration and pack cementation onto a C/C composite. It displays superior ablation resistance at temperatures from 2,000–3,000 °C, compared to existing ultra-high temperature ceramics (for example, a rate of material loss over 12 times better than conventional zirconium carbide at 2,500 °C). The carbide is a substitutional solid solution of Zr–Ti containing carbon vacancies that are randomly occupied by boron atoms. The sealing ability of the ceramic’s oxides, slow oxygen diffusion and a dense and gradient distribution of ceramic result in much slower loss of protective oxide layers formed during ablation than other ceramic systems, leading to the superior ablation resistance.