Recent advances regarding the interplay between ab initio calculations and metrology are reviewed, with particular emphasis on gas-based techniques used for temperature and pressure measurements. Since roughly 2010, several thermophysical quantities – in particular, virial and transport coefficients – can be computed from first principles without uncontrolled approximations and with rigorously propagated uncertainties. In the case of helium, computational results have accuracies that exceed the best experimental data by at least one order of magnitude and are suitable to be used in primary metrology. The availability of ab initio virial and transport coefficients contributed to the recent SI definition of temperature by facilitating measurements of the Boltzmann constant with unprecedented accuracy. Presently, they enable the development of primary standards of thermodynamic temperature in the range 2.5–552 K and pressure up to 7 MPa using acoustic gas thermometry, dielectric constant gas thermometry, and refractive index gas thermometry. These approaches will be reviewed, highlighting the effect of first-principles data on their accuracy. The recent advances in electronic structure calculations that enabled highly accurate solutions for the many-body interaction potentials and polarizabilities of atoms – particularly helium – will be described, together with the subsequent computational methods, most often based on quantum statistical mechanics and its path-integral formulation, that provide thermophysical properties and their uncertainties. Similar approaches for molecular systems, and their applications, are briefly discussed. Current limitations and expected future lines of research are assessed.