Recent work on the characterization of small exoplanets has allowed us to accumulate growing evidence that sub-Neptunes with radii greater than ∼2.5 R
⊕ often host H2/He-dominated atmospheres both from measurements of their low bulk densities and from direct detections of their low mean molecular mass atmospheres. However, the smaller sub-Neptunes in the 1.5–2.2 R
⊕ size regime are much less understood and often have bulk densities that can be explained either by the H2/He-rich scenario or by a volatile-dominated composition known as the “water world” scenario. Here we report the detection of water vapor in the transmission spectrum of the 1.96 ± 0.08 R
⊕ sub-Neptune GJ 9827 d obtained with the Hubble Space Telescope (HST). We observe 11 HST Wide Field Camera 3 transits of GJ 9827 d and find an absorption feature at 1.4 μm in its transit spectrum, which is best explained (at 3.39σ) by the presence of water in GJ 9827 d’s atmosphere. We further show that this feature cannot be caused by unocculted starspots during the transits by combining an analysis of the K2 photometry and transit light source effect retrievals. We reveal that the water absorption feature can be similarly well explained by a small amount of water vapor in a cloudy H2/He atmosphere or a water vapor envelope on GJ 9827 d. Given that recent studies have inferred an important mass-loss rate (>0.5 M
⊕ Gyr−1) for GJ 9827 d, making it unlikely to retain a H-dominated envelope, our findings highlight GJ 9827 d as a promising water world candidate that could host a volatile-dominated atmosphere. This water detection also makes GJ 9827 d the smallest exoplanet with an atmospheric molecular detection to date.