Attempting to deduce the temperature of space is a fascinating exercise, but typically there isn't a simple, straightforward answer.
Temperature is a measurement of the kinetic energy of matter particles.
Astronomers often refer to the ‘temperature’ of a region of space to indicate the kinetic energy of matter in that region.
Generally, there isn’t enough matter in space to transfer this heat (or coldness) to other objects.
So if you place an object in space, the temperature it attains depends on how much radiation it receives and how good it is at absorbing and emitting that radiation.
Put it near a star and it will generally heat up, for example.
Its temperature, however, is just a measure of the heat balance between the object and its surroundings, and is not the temperature of ‘space’.
So what temperature in space can we measure?
Space itself doesn’t consist of matter and so doesn’t have a temperature.
There is a lot of variation in temperature throughout the Universe.
The coldest naturally-occurring temperature in the Universe was discovered inside the Boomerang Nebula in 1995.
This cloud of gas and dust, in the constellation of Centaurus, was thrown off by a star nearing the end of its life.
Its temperature, a result of the slow expansion of the gas cloud, is only -272°C.
The hottest temperatures in space (not including the Big Bang itself) are likely to be generated in the cataclysmic interactions that create Gamma-Ray Bursts (GRBs) and may be as high as a trillion degrees.
Between these two extremes there is an enormous range of temperatures and the temperatures of objects are constantly changing.
How cold can anything be?
Physicists have determined that there is a lower limit to the temperature scale called ‘absolute zero’. It occurs at -273.15°C, or 0 Kelvin (K).
No matter how much you cool something, it can never achieve absolute zero (though you can get pretty close).
Strictly speaking, the coldest place in the Universe was in a laboratory in Finland in 2000, when a temperature only 100 trillionths of a degree above absolute zero was artificially created.
The average temperature of space
But, what about the overall or average temperature of the Universe?
Astronomers often regard the temperature of the Cosmic Microwave Background as the temperature of ‘space’. It has a temperature of 2.735 K (-270.415°C).
The Cosmic Microwave Background is a snapshot of the oldest light in the Universe, imprinted on the sky when the Universe was just 380,000 years old and first became transparent to light.
The Big Bang theory predicts that as the Universe expands this temperature should drop, just as an expanding gas cools.
This is exactly what astronomers have found by deducing the temperature of the Cosmic Microwave Background at various distances across the Universe.
When the Cosmic Microwave Background radiation was emitted it would have been around 3,000 K.
So, given that space is so cold, does water immediately freeze on exposure to the vacuum of space? Yes and no.
For water to remain liquid it requires both high temperature and high pressure.
With pressure completely removed water will immediately become a vapour, i.e. it will boil.
Almost immediately, though, that water vapour will freeze into a mist of ice particles.