Overview
All solids, liquids and gases consist of very small particles, the atoms and molecules. These are in constant disordered motion and forces act between them. By "disordered" in this context we mean, for example, that the velocity vectors of the particles of a body, relative to the velocity of its centre of mass, are distributed uniformly over all directions and also differ in their magnitudes. The mean value of the velocity magnitudes depends on the type of substance, the state of aggregation and, above all, the temperature. For solids, liquids and gases, the higher the temperature of a body, the greater the mean velocity of its particles. In general, this also applies to all other forms in which the particles can possess energy in a disordered manner, e.g. rotational movements, oscillations (this also includes lattice oscillations around their rest position in the crystal lattice of solid bodies). This illustrative connection already suggests that there is a lowest possible temperature, absolutezero, at which the smallest particles no longer move. Due to the uncertainty principle, however, complete motionlessness is not possible (zero-point energy).
A particular temperature that applies uniformly throughout the system exists only when the system is in a state of thermal equilibrium. Systems that are not in a state of equilibrium often consist of subsystems, each with its own temperatures, e.g. tap water and ice cubes in a glass, or the electrons and ions in a non-equilibrium plasma, or the degrees of freedom each for translation, rotation or vibration in an expanding molecular beam. If there is thermal contact between the subsystems, then the overall system will automatically strive towards a state of thermal equilibrium through heat exchange between the parts.
In theoretical terms, temperature is introduced as a fundamental concept by the fact that any two systems that are in thermal equilibrium with a third system are then also in thermal equilibrium with each other. This fact is also called the zeroth law of thermodynamics. Equality of temperatures means thermal equilibrium, i.e., there is no heat exchange even in the presence of thermal contact. The fact that a single state variable such as temperature is sufficient for deciding whether equilibrium exists can be derived from the zeroth law.
The sum of all energies of the disordered motions of the particles of a system and their internal potential and kinetic energies represents a certain energy content, which is called the internal energy of the system. The internal energy can be partially converted into ordered motion by means of a heat engine and then do work when a second system with a lower temperature is available. This is because only part of the internal energy can be used to convert it into work, while the rest must be given off as waste heat to the second system. According to the Second Law of Thermodynamics, there is a lower bound for this waste heat that is independent of the substances and types of processes used and is determined only by the ratio of the two temperatures. This was noticed by Lord Kelvin in 1848 and has been used to define the thermodynamic temperature since 1924. The same result is obtained if the state variable entropy is derived from the internal energy.
Almost all physical and chemical properties of substances are (at least weakly) dependent on temperature. Examples are the thermal expansion of substances, the electrical resistance, the solubility of substances in solvents, the speed of sound or the pressure and density of gases. In contrast, sudden changes in substance properties occur even with the smallest changes in temperature, when the state of aggregation changes or another phase transition occurs.
Temperature also influences the reaction rate of chemical processes in that this typically doubles for every 10 °C increase in temperature (van 't Hoff's rule). This also applies to the metabolic processes of living organisms.
Ideal gas
The ideal gas is a model gas that is well suited for developing the basics of thermodynamics and properties of temperature. According to the model, the particles of the gas are point-like, but can still collide elastically against each other and against the wall of the vessel. Otherwise, there is no interaction between the particles. The ideal gas reproduces the behaviour of monatomic noble gases very well, but also applies to normal air to a good approximation, although polyatomic molecules can rotate or vibrate and therefore cannot always be simplified as point-like objects without internal degrees of freedom.
For the ideal gas, the temperature is
proportional to the mean kinetic energy
of the particles

Where is
the Boltzmann constant. So in this case, the macroscopic quantity temperature is linked to microscopic particle properties in a very simple way.
Multiplied by the particle number , we get the total energy of the gas. Furthermore, the thermal equation of state applies to the ideal gas, which links the macroscopic quantities temperature, volume
and pressure , 
.
This equation was made the defining equation of temperature in the International System of Units in 2019 because, with the simultaneous numerical specification of the value of the Boltzmann constant, it contains only measurable quantities apart from T. The measurement specification takes into account that this equation is only approximately satisfied for a real gas, but holds exactly in the limiting case . 
Since the quantities
cannot become negative, we can see from these equations that there must be an absolute zero temperature
must exist at which the gas particles would stop moving, and the pressure or volume of the gas would be zero. Absolute zero temperature really does exist, although this derivation is not valid because there is no substance that would remain gaseous to
would remain gaseous. However, helium is still an almost ideal gas under atmospheric pressure at temperatures of a few K.
Temperature, heat and thermal energy
Sometimes the quantities temperature, heat and thermal energy are confused with each other. However, they are different quantities. Temperature and thermal energy describe the state of a system, temperature being an intensive quantity, but thermal energy (which can have different meanings) is often an extensive quantity. In ideal gases, temperature is a direct measure of the mean value of the kinetic energy of the particles. The thermal energy in its macroscopic meaning is equal to the internal energy, which is the sum of all kinetic, potential and excitation energies of the particles.
Heat, on the other hand, as a physical concept, does not characterize a single system state, but rather a process that leads from one system state to another. Heat is the change in internal energy minus any work done (see First Law of Thermodynamics). Conversely, if one assumes a certain amount of heat released or absorbed, then the process can lead to different final states with different temperatures depending on the process control (e.g. isobaric, isochoric or isothermal).
Temperature compensation
If two systems with different temperatures
are in a connection that allows heat transfer (thermal contact or diabatic connection), then heat flows from the hotter to the colder system and both temperatures approach the same equilibrium temperature
. If no phase transitions or chemical reactions occur during this process,
between the initial temperatures.
is then a weighted average of
and
, where the heat capacities
of the two systems (if sufficiently constant) act as weight factors. The same end result also occurs when two liquids or two gases are mixed together (mixing temperature), e.g. hot and cold water. If phase transitions occur, the equilibrium temperature can also be equal to one of the two initial temperatures, e.g. 0 °C when cooling a warm drink with an unnecessary amount of ice cubes from 0 °C. In chemical reactions, the final temperature may also be outside the range , e.g.
below in the case of cold mixtures, above in the case of combustion.
Temperature in relativity
→ Main article: Relativistic thermodynamics
A thermodynamic equilibrium is first valid in the common rest system of both bodies. In the sense of special relativity, a system in thermodynamic equilibrium is therefore characterized by a rest system in addition to the temperature. Thermodynamic equations, however, are not invariant under Lorentz transformations. A concrete question would be, for example, what temperature is measured by a moving observer. The redshift of thermal radiation, for example, shifts the frequencies in Planck's radiation law in the ratio
and thus makes a radiating body appear colder as one moves away from it with velocity .
In principle, the same problem already occurs when hot water flows through an initially cold pipe.
The temperature is represented as a time-like four-vector. Thus, in the system at rest, the three spatial coordinates are
and the time coordinate is the usual temperature. To a moving system, one must convert using the Lorentz transformation. However, it is more convenient in the context of the equations of state, and therefore more usual, to use the inverse temperature, more precisely β
, to be represented as a time-like four-vector.
To justify this, consider the 1st law, for reversible processes in the form
,
and note that the energy of a moving system is greater by the kinetic energy than its internal energy
, for
thus approximately

Where
is the three-dimensional velocity. Therefore
and
,
in 4-dimensional notation therefore equals
,
If
(with spatial momentum vector
) the quadruple momentum and θ
is the inverse quad temperature.
In general relativity, spacetime is curved, so in general the thermodynamic limit is not well-defined. However, if the metric of spacetime is time-independent, i.e. static, a global temperature term can be defined. In the general case of a time-dependent metric, such as is the basis of the description of the expanding universe, state variables such as temperature can only be defined locally. A common criterion for a system to be at least locally thermal is that the phase space density satisfies the Boltzmann equation without scattering.
Temperature in quantum physics
In the field of quantum physics, temperature can be described by a disordered particle motion in which all possible forms of energy occur only if it is "sufficiently high". "Sufficiently high" here means that the energy
is large compared to the typical distances between the energy levels of the individual particles in the given system. For example, the temperature must be well above 1000 K for molecular vibrations to be co-excited in diatomic gases such as N2, O2. For H2 molecules, excitation of rotation also requires temperatures above a few 100 K. Degrees of freedom which do not participate in the thermal motion at lower temperatures are called frozen. This is clearly expressed, for example, in the temperature dependence of the specific heat.
The theoretical treatment of thermodynamics in quantum physics is carried out exclusively with the methods of statistical physics (see quantum statistics, many-particle theory). In it, the temperature occurs exactly as in classical statistical physics in the exponent of the Boltzmann distribution and thus determines the form of the frequency distribution with which the particles assume the various energy states.