Temperature Units

Handling of temperatures requires special care because temperatures are typically expressed in scales, like Celsius or Fahrenheit, with an arbitrary choice of zero. Differences of temperatures are standard quantities with a well-defined zero value. Therefore, a distinction between temperatures and temperature differences is needed. The Wolfram Language quantity framework distinguishes "DegreesCelsius" as a unit of temperature from "DegreesCelsiusDifference" as a unit of temperature difference. Both have unit dimensions of "TemperatureUnit".
Temperature versus Temperature Difference
Temperature units represent the hotness of matter and are measured using a thermometer that uses a scale such as Fahrenheit, Celsius or Kelvin. Common instances of temperature may be measuring ambient temperature, the body temperature of a patient or the boiling point of a substance. Temperature scales have a zero value that may or may not correspond to absolute zero.
Get the air temperature for your current location, in appropriate units for your geo location:
Find the typical range of body temperatures for domesticated dogs:
The boiling point of water is represented as a temperature:
Temperature differences represent the relative distance between temperatures, also measured using a temperature scale. Temperature differences are typically used to indicate a change in temperature, or the difference between two temperatures, and thus do not typically directly reference absolute zero.
Units of temperature difference are typeset differently than units of temperature:
Find the difference in temperature between January 1 and July 1, 2022, in Chicago:
Temperatures expressed in Kelvin are equivalent to differences with respect to absolute zero, and therefore there is no need to separate units of temperature and temperature difference in Kelvin.
Quantity expressions given in "KelvinsDifference" will automatically convert to "Kelvins":
Find the critical-point temperature for water:
Find the temperature difference between the critical-point temperature for water and carbon dioxide:
Converting Temperatures
Temperatures may be freely converted from one scale to another, such as converting from Fahrenheit to Celsius or Kelvins using UnitConvert:
Temperature differences may also be freely converted:
Exceptionally, temperatures may be converted into temperature differences, being interpreted as temperature differences from absolute zero.
A warning message will be emitted when a temperature in degrees Celsius or Fahrenheit is converted into a temperature difference:
That computation is equivalent to first converting to Kelvins and then converting into a temperature difference:
Another way to understand conversion of temperatures into temperature differences is as a difference with absolute zero:
Temperature differences cannot be directly converted to temperatures:
If necessary, temperature difference may be converted to Kelvins and then manually converted:
Adding Temperatures
For arithmetic operations like addition, the distinction between temperature and temperature difference units impacts the resulting quantity arithmetic. Temperature difference units may be added to a temperature to produce a temperature, temperature difference units may be added to produce a temperature difference or temperatures may be added to produce a temperature.
One common arithmetic operation is to add a temperature difference to a temperature:
Temperature differences of one scale may be added to temperatures of another:
The sum of temperature difference units will be a temperature difference:
When adding two temperature quantities, the result will be the sum of the values including the difference from absolute zero. The result of summing two temperatures is equivalent to converting those temperatures to Kelvin and then summing, with results canonically given in Kelvin:
The previous operation is equivalent to first converting the temperatures to Kelvin before summing:
Kelvin and Celsius share the same scaling factor:
Subtracting Temperatures
Temperature differences represent the distance between two temperatures, and thus the result of subtracting one temperature from another is a temperature difference. Temperature differences may also be subtracted from a temperature to produce another temperature. Subtracting a temperature from a temperature difference will also produce a temperature, one that is equivalent to the inverted sign of that temperature difference subtracted from the temperature.
Subtracting one temperature from another will result in a temperature difference:
Subtracting a temperature difference from a temperature produces another temperature:
is equivalent to -(
Multiplying Temperatures
Multiplication of temperatures is equivalent to adding temperatures and is canonically given in Kelvin. Because some temperature scales' zero values do not represent absolute zero, multiplication by a negative number will not migrate the sign into the temperature quantity.
Multiplying a temperature by 2 gives the same result as adding that temperature to itself:
Multiplying a temperature by 1 will keep the sign outside of the quantity:
Adding the result to a temperature will produce a temperature difference:
The sign remains outside of the temperature quantity, even for negative temperature values:
Dividing Temperatures
Division by temperature units will produce a quantity equivalent to the temperature converted to Kelvin before division, with results canonically given in Kelvin. Division of one temperature by another will result in a numeric ratio given by the value of both temperatures in Kelvin.
Division by a temperature is equivalent to division by that same value in Kelvin:
Temperatures in compound units will be automatically normalized to Kelvin:
This is equivalent to division of the quantities themselves:
This is also equivalent to conversion to Kelvin prior to division: