A thin liquid film subject to a temperature gradient is known to deform under the action of thermocapillary stresses which induce convective cells. The free surface deformation can be thought of as the signature of the imposed temperature gradient, and this study investigates the inverse problem of trying to reconstruct the temperature field from known free surface variations. The present work builds on the analysis of Tan et al. [“Steady thermocapillary flows of thin liquid layers I. Theory”, Phys. Fluids A2 (1990) 313–321, doi:10.1063/1.857781] which provides a long-wave evolution equation for the fluid film thickness variation on nonuniformly heated substrates and proposes a solution strategy for the planar flow version of this inverse problem. The present analysis reveals a particular case for which there exists an explicit, closed-form solution expressing the local substrate temperature in terms of the local film thickness and its spatial derivatives. With some simplifications, this analysis also shows that this solution applies to three-dimensional flows. The temperature reconstruction strategies are successfully tested against “artificial” experimental data (obtained by solving the direct problem for known temperature profiles) and actual experimental data.