Nanocrystal formation of SnO 2 in xSnO 2-(100 - x)MgO (x in mol.%) nanocrystalline composite thin films is reported. SnO 2 and MgO exhibit strong immiscibility behavior below 750 °C, leading to controllable particle size of SnO 2 in the MgO matrix by changing their composition. The particle size of SnO 2 can also be controlled by increasing the annealing temperature. Above 750 °C MgO and SnO 2 react to yield a MgO-Mg 2SnO 4-SnO 2 composite in which the size of the SnO 2 nanophase increases with increasing temperature. By controlled choice of the composition and annealing conditions the band gap of SnO 2 can be continuously increased from 3.89 to 4.5 eV. We discuss this behavior in terms of the quantum confinement effect. The method provides a generic approach to tuning the band gap in nanocomposite systems over a wide energy range. © 2011 Acta Materialia Inc. Published by Elsevier Ltd. All rights reserved.