Résumé : Context. The stable element hafnium (Hf) and the radioactive element thorium (Th) were recently suggested as a suitable pair for radioactive dating of stars. The applicability of this elemental pair needs to be established for stellar spectroscopy.Aims. We aim at a spectroscopic determination of the abundance of Hf and Th in the solar photosphere based on a COBOLD 3D hydrodynamical model atmosphere. We put this into a wider context by investigating 3D abundance corrections for a set of G- and F-type dwarfs.Methods. High-resolution, high signal-to-noise solar spectra were compared to line synthesis calculations performed on a solar COBOLD model. For the other atmospheres, we compared synthetic spectra of COBOLD 3D and associated 1D models.Results. For Hf we find a photospheric abundance (Hf) = 0.87 0.04, in good agreement with a previous analysis, based on 1D model atmospheres. The weak Th II 401.9 nm line constitutes the only Th abundance indicator available in the solar spectrum. It lies in the red wing of a Ni-Fe blend exhibiting a non-negligible convective asymmetry. Accounting for the asymmetry-related additional absorption, we obtain (Th) = 0.08 0.03, consistent with the meteoritic abundance, and about 0.1 dex lower than obtained in previous photospheric abundance determinations. Conclusions. Only for the second time, to our knowledge, has a non-negligible effect of convective line asymmetries on an abundance derivation been highlighted. Three-dimensional hydrodynamical simulations should be employed to measure Th abundances in dwarfs if similar blending is present, as in the solar case. In contrast, 3D effects on Hf abundances are small in G- to mid F-type dwarfs and sub-giants, and 1D model atmospheres can be conveniently used. © 2008 ESO.