The increasing importance of hydrogen as an energy carrier and industrial material calls for hydrogen sensors with higher sensitivity, better selectivity, faster response, and wider dynamic range. Here, we report a nanofiber (NF) sensor that satisfies these requirements with a single sensing element. The sensor is based on stimulated Raman scattering spectroscopy, but the tightly confined evanescent field associated with the NF enhances the Raman gain per unit length by a factor of 30 to 10 2 over the state-of-the-art hollow-core photonic crystal fibers and more than 10 4 over free-space beams. The NF has excellent mode quality, which ensures mode-noise-free measurement and maximizes the signal-to-noise ratio. An experiment with a 700-nm-diameter, 48-mm-long silica NF operating in the telecom wavelength band demonstrates hydrogen detection from a few parts per million to 100% with a response time less than 10 s. The sensor would be useful for a range of applications, including detection of hydrogen leakage as well as monitoring of battery charging, fuel cells, and electric power transformer health conditions.