Skip to main content

Kelvin to RGB: color temperature to HEX

Enter a color temperature in kelvin and get the color of a black body at that temperature in HEX and RGB, from deep orange at 1000 K to pale blue at 40000 K.

Color temperature

K

Black body, CIE 1931

#FFAD59

Planck’s law and the CIE 1931 observer, shown against the sRGB white (D65).

Common approximation (Tanner Helland)

#FFA757

A curve fitted to blackbody data, widely used in code. Difference from the left: ΔE 2000 2.2.

  • RGB: 255, 173, 89
  • CIE xy: 0.4599, 0.4106
Black-body color from 1000 to 12000 K; the frame marks 2700 K. Ticks: the nominal color temperatures of LED lamps in ANSI C78.377-2024 — 1800, 2000, 2200, 2500, 2700, 3000, 3500, 4000, 4500, 5000, 5700, 6500 K. A lamp sold under one of them is close to, not exactly on, this color.
0.00.00.20.20.40.40.60.60.80.8xy4604805005205405605806007001000 K2000 K4000 K10000 KD65
The curve is the color of a black body, from 1000 K at the orange end to 40000 K at the blue end. D65, the white of an sRGB screen, sits just above the curve near 6500 K: daylight is not a black body. The triangle is what an sRGB screen can show; outside it the fill is only the nearest hue.

How the color is calculated

Planck’s law gives how much light a black body emits at each wavelength. That spectrum is multiplied by the CIE 1931 color-matching functions at every nanometre from 360 to 830 nm and summed to X, Y and Z, then converted to sRGB and scaled so the brightest channel is full. The second radiation constant is the exact CODATA 2022 value.

No white-balance correction is applied: the color is shown as it would look next to the screen’s own white, D65. A camera or a game engine that white-balances to the light would show a different color, so for those uses check what your software expects.

Kelvin to RGB: questions

What RGB color is 2700 K or 6500 K?
Type the temperature or press a preset. By this page’s calculation 2700 K, the soft or warm white of many household bulbs, is about #FFAD59, and 6500 K is close to white with a faint pink tint, about #FFF8FE. The color is that of an ideal black body at that temperature, shown on an sRGB screen.
Why is 6500 K not pure white?
The white of an sRGB screen is CIE illuminant D65, a model of daylight, which is often described as 6500 K. Daylight is not a black body: its chromaticity (x 0.3127, y 0.3290) lies a little off the black-body curve, which at 6500 K sits at about x 0.3135, y 0.3236. So a true 6500 K black body looks very slightly pinkish next to screen white.
How is this different from the Tanner Helland formula?
Tanner Helland’s 2012 formula is a curve fitted to a published black-body table, based on the CIE 1964 10° observer, and is widely copied into code. This page computes the color directly from Planck’s law and the CIE 1931 table and shows the formula’s result next to it with the difference in ΔE 2000. Over most of the range they agree within about 0.5 to 4; the gap is largest near 6500 K, where the formula gives an almost pure white.
Why do the lowest temperatures say “outside what a screen can show”?
Below about 1900 K the black-body color is more saturated orange-red than the sRGB triangle allows; a candle flame, about 1850 K, is just past that edge. The page then adds white light until it fits, which keeps the hue line, and tells you how much was added.
Does a bulb labelled 2700 K look exactly like this?
Not exactly. The label is a correlated color temperature: the bulb’s light is close to, not on, the black-body color. Your screen, its settings and the room light change what you see too. Use the value as a starting point for design, not as a measurement of a real lamp.

Sources

  1. International Commission on Illumination (CIE) (2019). Colour-matching functions of CIE 1931 standard colorimetric observer (dataset), 360–830 nm in 1 nm steps, from CIE 018:2019. Licence CC BY-SA 4.0. DOI
  2. NIST, CODATA 2022 recommended values: second radiation constant c₂ = 1.438 776 877… × 10⁻² m K (exact). Link
  3. Helland T. (2012). How to convert temperature (K) to RGB: algorithm and sample code. A curve fit to Mitchell Charity’s blackbody table; stated for 1000–40000 K. Link
  4. Livingston J. (3 Feb 2025). ANSI C78.377 adds two new CCTs. Designing Light. On the 2024 edition of ANSI C78.377 (chromaticity of solid-state lighting products): nominal CCTs 2200–6500 K, plus 1800 and 2000 K added in 2024. A trade article; the standard itself is a paid document. Link
  5. Wikipedia, «Color temperature», table of example light sources (read 8 Nov 2026): candle flame 1,850 K; «soft white» LED lamps 2,700 K; «warm white» LED lamps 3,000 K; horizon daylight 5,000 K; daylight, overcast, daylight LED lamps 6,500 K. A secondary source; the names on real bulb boxes vary by maker. Link