We observe localization of excitons in semiconducting single-walled carbon nanotubes at room temperature using high-resolution near-field photoluminescence (PL) microscopy. Localization is the result of spatially confined exciton energy minima with depths of more than 15 meV connected to lateral energy gradients exceeding 2 meV/nm as evidenced by energy-resolved PL imaging. Simulations of exciton diffusion in the presence of energy variations support this interpretation predicting strongly enhanced PL at local energy minima.