We use a combination of density functional theory and multistate diffusion formalism to analyze the diffusion of oxygen and nitrogen in technologically important hafnium metal. Comparing the local density approximation and the Perdew-Burke-Ernzerhof version of the generalized gradient approximation, we find that a better description of the hafnium lattice in the latter results in the correct sequence of stable and transition states for oxygen interstitials leading to essentially quantitative agreement with experiment. For oxygen diffusion, we find an isotropic temperature-dependent diffusion coefficient of D =0.082e-2.04/kBTcm2s-1 utilizing interstitial sites with hexahedral and octahedral coordination. For the diffusivity of nitrogen, we find that an additional stable interstitial site, the crowdion site, exists and that the diffusion coefficient is D =0.15e-2.68/kBTcm2s-1. Our results also reproduce the experimental observation that nitrogen diffusivity is lower than that of oxygen in hafnium.