  Ordinary matter is described by six fundamental parameters: three couplings
(gravitational, electromagnetic and strong) and three masses: the electron's
(m_e) and those of the up (m_u) and down (m_d) quarks. An additional mass
enters through quantum fluctuations: the strange quark mass (m_s). The three
couplings and m_e are known with an accuracy of better than a few per mil.
Despite their importance, $m_u$, $m_d$ (their average m_{ud}) and m_s are
relatively poorly known: e.g. the Particle Data Group quotes them with
conservative errors close to 25%. Here we determine these quantities with a
precision below 2% by performing ab initio lattice quantum chromodynamics (QCD)
calculations, in which all systematics are controlled. We use pion and quark
masses down to (and even below) their physical values, lattice sizes of up to 6
fm, and five lattice spacings to extrapolate to continuum spacetime. All
necessary renormalizations are performed nonperturbatively.
