Three Earth-sized exoplanets were recently discovered close to the habitable zone1,2of the nearby ultracool dwarf star TRAPPIST-1 (ref.3). The nature of these planets has yet to be determined, as their masses remain unmeasured and no observational constraint is available for the planetary population surrounding ultracool dwarfs, of which the TRAPPIST-1 planets are the first transiting example. Theoretical predictions span the entire atmospheric range, from depleted to extended hydrogen-dominated atmospheres4,5,6,7,8. Here we report observations of the combined transmission spectrum of the two inner planets during their simultaneous transits on 4 May 2016. The lack of features in the combined spectrum rules out cloud-free hydrogen-dominated atmospheres for each planet at ≥10σlevels; TRAPPIST-1 b and c are therefore unlikely to have an extended gas envelope as they occupy a region of parameter space in which high-altitude cloud/haze formation is not expected to be significant for hydrogen-dominated atmospheres9. Many denser atmospheres remain consistent with the featureless transmission spectrum—from a cloud-free water-vapour atmosphere to a Venus-like one.