Transition metal carbide is a class of materials characterized by high hardness, high melting points, and low chemical reactivity. It is widely used in industrial applications involving exposure to elevated temperatures, aggressive media, and heavy loads, and is thus of technological and industrial importance. In this paper the high-temperature thermodynamic properties of tungsten carbide, WC, is studied. At most temperatures below melting, WC assumes a hexagonal structure with essentially no vacancies (δ -WC). Only at very high temperatures (around 3000 K), WC crystallizes in the cubic rocksalt structure (γ -WC), which is more common for the transition metal carbides and in the case for WC can contain up to 40% carbon vacancies. At lower temperatures, γ -WC can, however, form as thin interfacial structures or nanoparticles. Hence, the thermodynamic properties of both γ -WC and δ -WC are of relevance. Here, we conduct a first-principles density-functional theory based computational investigation of the γ -WC and δ -WC phases, which requires modeling of high carbon vacancy concentrations at high temperatures. The configurational degrees of freedom are modeled with an alloy cluster expansion and sampled through Monte Carlo simulations. To account for the dynamic instability of the cubic γ -WC phase at low temperatures, the vibrational degrees of freedom are treated using effective harmonic models constructed from ab initio molecular dynamics simulations. Finally, we obtain a part of the W-C phase diagram in reasonably quantitative agreement with experimental data.