Ultralight axions ( ULAs ) with masses in the range 10 ^ { -33 } ~ { } { eV } \leq m _ { a } \leq 10 ^ { -20 } ~ { } { eV } are motivated by string theory and might contribute to either the dark-matter or dark-energy densities of the Universe . ULAs could suppress the growth of structure on small scales , lead to an altered integrated Sachs-Wolfe effect on cosmic microwave-background ( CMB ) anisotropies , and change the angular scale of the CMB acoustic peaks . In this work , cosmological observables over the full ULA mass range are computed and then used to search for evidence of ULAs using CMB data from the Wilkinson Microwave Anisotropy Probe ( WMAP ) , Planck satellite , Atacama Cosmology Telescope , and South Pole Telescope , as well as galaxy clustering data from the WiggleZ galaxy-redshift survey . In the mass range 10 ^ { -32 } ~ { } { eV } \leq m _ { a } \leq 10 ^ { -25.5 } ~ { } { eV } , the axion relic-density \Omega _ { a } ( relative to the total dark-matter relic density \Omega _ { d } ) must obey the constraints \Omega _ { a } / \Omega _ { d } \leq 0.05 and \Omega _ { a } h ^ { 2 } \leq 0.006 at 95 \% -confidence . For m _ { a } \mathrel { \hbox { \hbox to 0.0 pt { \lower 2.365 pt \hbox { $ \sim$ } } \kern - 3.0 pt% \raise 1.72 pt \hbox { $ > $ } } } 10 ^ { -24 } ~ { } { eV } , ULAs are indistinguishable from standard cold dark matter on the length scales probed , and are thus allowed by these data . For m _ { a } \mathrel { \hbox { \hbox to 0.0 pt { \lower 2.365 pt \hbox { $ \sim$ } } \kern - 3.0 pt% \raise 1.72 pt \hbox { $ < $ } } } 10 ^ { -32 } ~ { } { eV } , ULAs are allowed to compose a significant fraction of the dark energy .