Nanoporous SiO2 and nanocomposite MgF2:SiO2 coatings have been deposited by sol gel dip-coating in a particle-free atmosphere. The refractive index of the prepared nanostructured thin films is determined from spectrophotometric data. In both cases, significantly lower values than for compact SiO2 have been achieved. Highly transparent samples have been produced in a single dip-coating step followed by simple thermal annealing in air. Broad spectral transmittance maxima are observed exceeding values of 98.5% (nanoporous SiO2) and 99.5% (quaternary Mg:F:Si:O films). MgF2:SiO2 nanocomposite thin films can be expected to exhibit a higher aging stability than porous SiO2 films with respect to pore-filling by hydrocarbons and are therefore a promising alternative as well for single-layered anti reflection coatings as for multilayered coulored coatings on solar collector glazing.