The ideas of thermodynamics have proved fruitful in the setting of quantum information theory, in particular the notion that when the allowed transformations of a system are restricted, certain states of the system become useful resources with which one can prepare previously inaccessible states. The theory of entanglement is perhaps the best-known and most well-understood resource theory in this sense. Here, we return to the basic questions of thermodynamics using the formalism of resource theories developed in quantum information theory and show that the free energy of thermodynamics emerges naturally from the resource theory of energy-preserving transformations. Specifically, the free energy quantifies the amount of useful work which can be extracted from asymptotically many copies of a quantum system when using only reversible energy-preserving transformations and a thermal bath at fixed temperature. The free energy also quantifies the rate at which resource states can be reversibly interconverted asymptotically, provided that a sublinear amount of coherent superposition over energy levels is available, a situation analogous to the sublinear amount of classical communication required for entanglement dilution. Quantum resource theories are specified by a restriction on the quantum operations (state preparations, measurements, and transformations) that can be implemented by one or more parties. This singles out a set of states which can be prepared under the restricted operations. If the parties facing the restriction acquire a quantum state outside the restricted set of states, then they can use this state to implement measurements and transformations that are outside the class of allowed operations, consuming the state in the process. Thus, such states are useful resources.A few prominent examples serve to illustrate the idea: if two or more parties are restricted to communicating classically and implementing local quantum operations, then entangled states become a resource [1]; if a party is restricted to quantum operations that have a particular symmetry, then states that break this symmetry become a resource [2][3][4]; if a party is restricted to preparing states that are completely mixed and performing unitary operations, then any state that is not completely mixed, i.e., any state that has some purity, becomes a resource [5].In this Letter, we develop the quantum resource theory of states that are T athermal, i.e., not thermal at temperature T. This provides a useful new formulation of equilibrium and nonequilibrium thermodynamics for finite-dimensional quantum systems, and allows us to apply new mathematical tools to the subject. The restricted class of operations which defines our resource theory includes only those that can be achieved through energy-conserving unitaries and the preparation of any ancillary system in a thermal state at temperature T, as first studied by Janzing et al. [6] in the context of Landauer's principle. Here, the ancillary systems can have an arbitrary Hilbert space and an a...