Depending on their mass, axions produced in the early universe can leave different imprints in cosmic structures. If axions have masses in the eV-range, they contribute a hot dark matter fraction, allowing one to constrain m(a) in analogy to neutrinos. In the more favored scenario where axions play the role of cold dark matter and if reheating after inflation does not restore the Peccei-Quinn symmetry, the axion field provides isocurvature fluctuations that are severely constrained by precision cosmology. There remains a small sliver in parameter space where isocurvature fluctuations could still show up in future probes.