Many methods have been developed for measuring temperature. Most of these rely on measuring some physical property of a working material that varies with temperature. One of the most common devices for measuring temperature is the glass thermometer. This consists of a glass tube filled with mercury or some other liquid, which acts as the working fluid. Temperature increase causes the fluid to expand, so the temperature can be determined by measuring the volume of the fluid. Such thermometers are usually calibrated so that one can read the temperature simply by observing the level of the fluid in the thermometer. Another type of thermometer that is not really used much in practice, but is important from a theoretical standpoint, is the gas thermometer.
Other important devices for measuring temperature include:
* Thermocouples
* Thermistors
* Resistance temperature detector (RTD)
* Pyrometer
* Langmuir probes (for electron temperature of a plasma)
*Infrared thermometer
* Other thermometers
One must be careful when measuring temperature to ensure that the measuring instrument (thermometer, thermocouple, etc.) is really the same temperature as the material that is being measured. Under some conditions heat from the measuring instrument can cause a temperature gradient, so the measured temperature is different from the actual temperature of the system. In such a case the measured temperature will vary not only with the temperature of the system, but also with the heat transfer properties of the system.
What thermal comfort humans, animals and plants experience is related to more than temperature shown on a glass thermometer. Relative humidity levels in ambient air can induce more or less evaporative cooling.  Measurement of the wet-bulb temperature normalizes this humidity effect.  Mean radiant temperature also can affect thermal comfort.  The wind chill factor makes the weather feel colder under windy conditions than calm conditions even though a glass thermometer shows the same temperature. Airflow increases the rate of heat transfer from or to the body, resulting in a larger change in body temperature for the same ambient temperature.
The theoretical basis for thermometers is the zeroth law of thermodynamics which postulates that if you have three bodies, A, B and C, if A and B are at the same temperature, and B and C are at the same temperature then A and C are at the same temperature.  B, of course, is the thermometer.
The practical basis of thermometry is the existence of triple point cells.  Triple points are conditions of pressure, volume and temperature such that three phases are simultaneously present, for example solid, vapor and liquid.  For a single component there are no degrees of freedom at a triple point and any change in the three variables results in one or more of the phases vanishing from the cell.  Therefore, triple point cells can be used as universal references for temperature and pressure (see Gibbs phase rule).
Under some conditions it becomes possible to measure temperature by a direct use of the Planck's law of black-body radiation. For example, the cosmic microwave background temperature has been measured from the spectrum of photons observed by satellite observations such as the WMAP. In the study of the quark–gluon plasma through  heavy-ion collisions, single particle spectra sometimes serve as a thermometer.