Thermal subsidence of the sea floor explains the observed bathymetry of ocean ridges. A similarity solution for a one-dimensional cooling model successfully predicts bathymetry, heat flow and geoid anomalies under a wide range of conditions. This similarity solution can be modified to predict the thermal subsidence of sedimentary basins. For older sedimentary basins it is necessary to consider an input of heat to the base of the lithosphere that places a limit on subsidence. The similarity solution for thermal subsidence is in quite good agreement with the observed subsidence history of a variety of sedimentary basins. Some basins subside freely and in others the flexural rigidity of the elastic lithosphere inhibits subsidence. An empirical model is proposed for the conversion of kerogen to oil and the subsequent conversion of oil to gas. This model is then used in conjunction with the thermal evolution predicted by the similarity solution in order to determine the oil window and relative volume of oil as a function of the age of the basin.