A spectroscopic comparison of ten hot-Jupiter exoplanets reveals that the difference between the planetary radius measured at optical and infrared wavelengths allows atmosphere types ranging from clear to cloudy to be distinguished; the difference in radius at a given wavelength correlates with the spectral strength of water at that wavelength, suggesting that haze obscures the signal from water. David Sing et al. present a set of ten broadband exoplanet spectra from Hubble Space Telescope and Spitzer observations that resolve both the optical scattering and infrared molecular absorption spectroscopically. They find that the difference between the planetary radius measured at optical and infrared wavelengths provides a metric that can distinguish between different atmospheric types. Significantly, strong water absorption lines are seen in clear-atmosphere planets, while the weakest features are associated with clouds and hazes, strongly arguing against primordial water depletion during formation, and indicating that clouds and hazes are the cause of weaker spectral signatures. These results clarify the diversity seen in hot Jupiters and illustrate the interplay of clouds, hazes and metallicity in exoplanet atmospheres. Thousands of transiting exoplanets have been discovered, but spectral analysis of their atmospheres has so far been dominated by a small number of exoplanets and data spanning relatively narrow wavelength ranges (such as 1.1–1.7 micrometres). Recent studies show that some hot-Jupiter exoplanets have much weaker water absorption features in their near-infrared spectra than predicted1,2,3,4,5. The low amplitude of water signatures could be explained by very low water abundances6,7,8, which may be a sign that water was depleted in the protoplanetary disk at the planet’s formation location9, but it is unclear whether this level of depletion can actually occur. Alternatively, these weak signals could be the result of obscuration by clouds or hazes1,2,3,4, as found in some optical spectra3,4,10,11. Here we report results from a comparative study of ten hot Jupiters covering the wavelength range 0.3–5 micrometres, which allows us to resolve both the optical scattering and infrared molecular absorption spectroscopically. Our results reveal a diverse group of hot Jupiters that exhibit a continuum from clear to cloudy atmospheres. We find that the difference between the planetary radius measured at optical and infrared wavelengths is an effective metric for distinguishing different atmosphere types. The difference correlates with the spectral strength of water, so that strong water absorption lines are seen in clear-atmosphere planets and the weakest features are associated with clouds and hazes. This result strongly suggests that primordial water depletion during formation is unlikely and that clouds and hazes are the cause of weaker spectral signatures.