What a Color Temperature Converter Does and How It Works
This colour temperature converter turns a light source's colour temperature, measured in Kelvin, into the RGB and hex colour it produces on screen, and converts back the other way. To be clear from the start, this tool is about the colour of light, not about weather or thermometers: a separate Celsius-to-Fahrenheit temperature converter exists for that. Here, Kelvin describes whether a white light looks warm and orange, like a candle or a tungsten bulb, or cool and blue, like an overcast sky, which is exactly the number you set as white balance on a camera or read off a light-bulb box. Photographers, lighting designers, and anyone choosing bulbs or matching studio lights use it to preview a colour temperature as an actual colour and to translate between the Kelvin scale and screen RGB.
The science behind it is the idea of a blackbody radiator, an idealised object that glows a predictable colour as it heats up. At lower temperatures around 1900 Kelvin it glows a warm orange, like a candle flame; as the temperature rises it passes through the warm white of a tungsten bulb near 2700 Kelvin, a neutral white around 4000 to 5000 Kelvin, the roughly neutral daylight near 5600 to 6500 Kelvin, and on into the cool blue of a clear sky at 10000 Kelvin and beyond. The set of colours a blackbody produces across temperatures traces a curve called the Planckian locus. Because there is no simple closed-form equation from Kelvin straight to RGB, the converter uses a well-known piecewise approximation, Tanner Helland's fit, which gives red, green, and blue as separate functions of temperature and is valid roughly from 1000 to 40000 Kelvin. That range covers every practical lighting situation.
Going the other way, from a colour back to Kelvin, is an approximation of a different kind. An arbitrary RGB colour usually does not lie exactly on the Planckian locus, so the tool finds the nearest point on the locus and reports the Kelvin value there. This is why entering a heavily tinted colour returns only a rough temperature: the answer is the closest blackbody colour, not an exact match, and colours far from the locus are not really described by a single temperature at all. For colours that are near white, though, the reverse conversion is genuinely useful for estimating a white balance.
Presets make the scale intuitive. Candle sits around 1900 Kelvin, tungsten near 2700, warm white about 3000, neutral around 4000, cool white near 5000, daylight roughly 5600, overcast about 6500, and a clear blue sky around 10000. A photographer previews how a scene shot at 3200 Kelvin will look before setting the camera, then matches continuous lights to the same value so a shot is consistent. An interior designer compares 2700 Kelvin warm white against 4000 Kelvin neutral for a room before buying bulbs. A video editor sets a colour cast to a specific Kelvin for a mood. A worked example: 2700 Kelvin comes out as a warm orange-white, approximately rgb(255, 169, 87), the cosy tone of a traditional incandescent bulb.
Keep the approximation's nature in mind. The Kelvin-to-RGB fit is an approximation of the blackbody curve, so the on-screen colour is a faithful preview rather than a laboratory-grade spectral rendering, and how it actually looks also depends on your display's calibration. The reverse direction is only meaningful for colours close to the locus, so treat a Kelvin value returned from a saturated colour as indicative at best. None of this reduces the tool's usefulness for previewing and communicating light colour, which is its real job. Everything is computed locally in your browser, so the converter works offline once the page has loaded and no value you enter is uploaded, logged, or stored anywhere.