We demonstrate an absolute magnetometer based on quantum beats in the ground state of nitrogen-vacancy centers in diamond. We show that, by eliminating the dependence of spin evolution on the zero-field splitting D, the magnetometer is immune to temperature fluctuation and strain inhomogeneity. We apply this technique to measure low-frequency magnetic field noise by using a single nitrogen-vacancy center located within 500 nm of the surface of an isotopically pure (99.99% 12C) diamond. The photon-shot-noise limited sensitivity achieves 38 nT/sqrt[Hz] for 4.45 s acquisition time, a factor of sqrt better than the implementation which uses only two spin levels. For long acquisition times (>10 s), we realize up to a factor of 15 improvement in magnetic sensitivity, which demonstrates the robustness of our technique against thermal drifts. Applying our technique to nitrogen-vacancy center ensembles, we eliminate dephasing from longitudinal strain inhomogeneity, resulting in a factor of 2.3 improvement in sensitivity.