ZnO–SnO2 nanocomposites were synthesized by a facile sol–gel synthesis route and characterized through X-ray diffraction, BET specific surface area analysis, UV–vis diffuse reflectance spectroscopy, photoluminescence spectroscopy, X-ray photoelectron spectroscopy, scanning electron microscopy, transmission electron microscopy. The photocatalytic activity of the samples was tested using the degradation of 4-nitrophenol under UV light as model reaction. The ZnO/SnO2 molar ratio was varied in order to study its influence on the photoefficiency of the samples. The ZnO–SnO2 nanocomposites showed higher photoactivity than the pure oxides and in particular the sample with ZnO/SnO2 molar ratio equal to 1/0.05 resulted the best one among the tested powders. The high activity of the mixed samples was attributed to the presence of heterojunctions between the two oxides, which allows an improved charge separation of the photogenerated electron–hole pairs, due to the differences between the energy levels of the conduction and valence bands of ZnO and SnO2. Photovoltage measurements were performed to determine the energy band structure of the ZnO–SnO2 heterojunction.