It has been a common assumption of interior models that the outer planets of our Solar system are convective, and that the internal temperature distributions are therefore adiabatic. This assumption is also often applied to exoplanets. However, if a large portion of the thermal flux can be transferred by conduction, or if convection is inhibited, the thermal profile could be substantially different and would therefore affect the inferred planetary composition. Here we investigate how the assumption of non-adiabatic temperature profiles in Uranus and Neptune affects their internal structures and compositions. We use a set of plausible temperature profiles together with density profiles that match the measured gravitational fields to derive the planets’ compositions. We find that the inferred compositions of both Uranus and Neptune are quite sensitive to the assumed thermal profile in the outer layers, but relatively insensitive to the thermal profile in the central, high-pressure region. The overall value of the heavy element mass fraction, Z, for these planets is between 0.8 and 0.9. Finally, we suggest that large parts of Uranus’ interior might be conductive, a conclusion that is consistent with Uranus dynamo models and a hot central inner region.