A novel synthetic route for the preparation of ZrO2 or HfO2 nanoparticles homogeneously dispersed in SiO2 thin films was developed. This route is based on the copolymerisation of organically modified crystalline oxozirconium or oxohafnium clusters (M4O2(OMc)12, M = Zr, Hf; OMc = OC(O)–C(CH3)CH2) with (methacryloxymethyl)triethoxysilane (MAMTES, CH2C(CH3)C(O)O–CH2Si(OCH2CH3)3). These crystalline clusters, which are the precursors for the corresponding metal oxides (MO2), were prepared via the sol–gel route by reaction of zirconium or hafnium butoxide (M(OBu)4) with methacrylic acid. The copolymerisation of the clusters with the methacrylate-functionalised siloxane was photoinitaited by Irgacure 184 and allowed the anchoring of the cluster to the forming silica network. The solution was cast into films by dip-coating and UV cured (10 min, 125 W) to promote the copolymerisation of the methacrylate groups of the cluster with those of the silane. Transparent and homogeneous films 200–450 nm thick were obtained after calcination at 800 °C in air. This route allowed the production of a very homogeneous dispersion of the MO2 precursors inside the silica matrix. The surface and in-depth composition of the thin films was investigated through IR, X-ray photoelectron spectroscopy (XPS) and secondary ion mass spectrometry (SIMS). SIMS and XPS depth profiles evidenced a very homogenous distribution of both zirconium or hafnium throughout the silica films and sharp film–substrate interfaces. The surface morphology of the coatings was investigated through atomic force microscopy (AFM), which showed smooth, homogeneous and crack-free surfaces. Through X-ray diffraction (XRD) the crystallisation of hafnium and zirconium oxides was revealed, while the presence of isolated crystalline nanoparticles having a diameter of 5–10 nm was evidenced by transmission electron microscopy (TEM). A pull-off test indicated a very good adhesion of the films to the substrate.