Colour temperature converter — Kelvin to HEX and back

Enter a colour temperature in Kelvin to get the matching light colour in HEX, RGB and HSL, or enter a colour to estimate its temperature and whether it reads as warm or cool.

Live demo · real result from this tool
Direction
2700 K#ffa757
RGB
rgb(255, 167, 87)
HSL
hsl(28.4, 100%, 67.1%)

Colours

Light sources from warm to cool

Kelvin → RGB uses Tanner Helland's approximation of blackbody colour; colour → Kelvin uses McCamy's formula on CIE xy, which only applies to near-white colours.

Processed on your device — nothing is uploaded.

How to use the colour temperature tool

  1. Choose the Direction: Kelvin → colour or Colour → temperature.
  2. For Kelvin to colour, enter the Colour temperature from 1000 K to 40000 K.
  3. For colour to temperature, set the Colour field to the colour you want to test.
  4. Read the result, then compare it with the reference strip of light sources from 1500 K to 15000 K.

What it does and when to use it

Photographers, game artists and interface designers often think about light in Kelvin: a warm 2700 K lamp, 5000 K studio light, a 6500 K daylight screen. This tool turns those numbers into colours you can use in CSS, a design tool or a shader, for example to tint a “night mode” overlay or to draw a candle flame.

The reverse direction gives a quick reading of an existing colour. It tells you whether a colour reads as warm, cool or neutral and, for off-whites and creams, roughly what light it resembles. To push a colour warmer by hand, rotate its hue with the HSL adjuster or blend in amber with the colour mixer. For an old-photo warmth, the sepia converter applies the CSS sepia filter.

How it works

Kelvin to colour. The tool uses Tanner Helland’s 2012 approximation, a set of curve fits to blackbody colour data. With T = Kelvin ÷ 100, red is 255 up to T = 66, then falls as a power curve; green follows a logarithm below 66 and a power curve above; blue is 0 below T = 19 and 255 from T = 66.

Colour to Kelvin. The colour is converted to CIE XYZ and then to chromaticity x and y. McCamy’s 1992 formula gives the temperature: n = (x − 0.332) ÷ (0.1858 − y), CCT = 449n³ + 3525n² + 6823.3n + 5520.33. Results outside 1000–40000 K are reported as not meaningful.

Warm or cool is judged by HSL hue: reds to yellows are warm, greens to violets are cool, and very grey, very dark or very light colours are neutral.

Worked examples

These come from the tool itself.

Input Result
6500 K #fffefa, almost white
2700 K #ffa757, warm orange-white
Colour #ffffff Neutral, 6,505 K
Colour #ffd8a8 Warm, 4,121 K
Colour #cadaff Cool, 10,028 K

White comes out near 6500 K because sRGB defines its white as the D65 daylight point.

Limits and tips

  • The Kelvin colours are an approximation of how light looks, not a colour-managed measurement.
  • Very high temperatures change little: 15000 K and 40000 K are both pale blue.
  • A “Low” reliability means the colour is far from white light, so its Kelvin value is only nominal.
  • It runs in your browser.

Frequently asked questions

What does colour temperature mean?
It describes the colour of light by comparing it with a heated ideal object, a blackbody. Low values such as 2000 K glow orange like candlelight; around 6500 K looks white like daylight; higher values look bluish.
Why is low Kelvin called warm when it is physically cooler?
The names come from how the colours feel, not from physics. Orange and red read as warm, blue as cool, even though bluish light corresponds to a hotter blackbody.
Why does converting 2700 K to a colour and back not give 2700 K?
The two directions use different published approximations. Kelvin to colour uses Tanner Helland's curve fit, and colour to Kelvin uses McCamy's formula. Going 2700 K to
Why does my blue say "Not meaningful"?
Temperature only describes colours close to the white-light curve. A saturated blue is not the colour of any blackbody, so the tool still says whether it feels warm or cool but gives no Kelvin value.
Is this accurate enough to match light bulbs?
Use it to choose screen colours that suggest a kind of light, such as a warm 2700 K glow. Real bulbs and screens differ, so for photography or lighting work rely on measured values.

Sources

  1. Tanner Helland, How to Convert Temperature (K) to RGB: Algorithm and Sample Code (2012) — tannerhelland.com, accessed 2026-10-08

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close