It is well established that TiC contains carbon vacancies not only in carbon-deficient environments but also in carbon-rich environments. We have performed density functional calculations of the vacancy formation energy in TiC for C- as well as Ti-rich conditions using several different approximations to the exchange-correlation functional, and also carefully considering the nature and thermodynamics of the carbon reference state, as well as the effect of varying growth conditions. We find that the formation of carbon vacancies is clearly favorable under Ti-rich conditions, whereas it is slightly energetically unfavorable under C-rich conditions. Furthermore, we find that the relaxations of the atoms close to the vacancy site are rather long-ranged, and that these relaxations contribute significantly to the stabilization of the vacancy. Since carbon vacancies in TiC are also experimentally observed in carbon-rich environments, we conclude that kinetics may play an important role. This conclusion is consistent with the experimentally observed high activation energies and sluggish diffusion of vacancies in TiC, effectively causing a freezing in of the vacancies.