Kelvin to RGB

Enter a temperature and see the swatch.

Use this tool

Result

The result appears in this panel after you run the tool.

About this tool

The curve is a common approximation for blackbody tints, not a spectral render.

Values far from 1000 to 12000 K are rejected.

How to use it

  1. Open this page and provide the input it asks for.
  2. Set the options that are visible, then use Convert temperature.
  3. Read the result in the panel. Copy it or download it when a file is offered. The input stays in this browser.

Limitations

Tanner Helland's curve, clamped into sRGB

The expression the temperature runs through

The input has to be a finite number from 1000 through 40000 inclusive. Outside that closed range the page rejects the value. Inside it, the temperature is divided by 100 to get a working variable. Red is 255 when that variable is at most 66, and otherwise 329.698727446 times (variable minus 60) raised to the power minus 0.1332047592. Green is 99.4708025861 times the natural log of the variable, minus 161.1195681661, when the variable is at most 66. Above that, green is 288.1221695283 times (variable minus 60) raised to minus 0.0755148492. Blue is 255 when the variable is at least 66. Blue is 0 when the variable is at most 19. Between those, blue is 138.5177312231 times the natural log of (variable minus 10), minus 305.0447927307. Each channel is rounded, then forced to stay inside the closed byte range from 0 to 255, and written as hex.

Those pieces are the Tanner Helland approximation for a blackbody tint. They are not an integral of Planck’s law against the CIE color-matching functions, and they are not a CCT calculation that solves for a closest point on the daylight locus. The breakpoints are in the scaled variable, so 6600 kelvin is where red stops being pinned at 255 and blue becomes pinned at 255. At 1900 kelvin and below, within the allowed range, blue is held at 0. A warm temperature therefore comes out red-orange. A high temperature comes out blue-white. The swatch uses that hex. The label shows the kelvin you typed.

Limits of the tint

The hex is an sRGB code, not a spectral power distribution. A calibrated display can depart from sRGB and show a different tint for the same hex. The page does not load a monitor profile. Print is not modeled. A press will not reproduce this RGB by printing the channels as inks, and there is no CMYK companion line. Values between 1000 and 40000 are allowed even when they are far from the temperatures people use for indoor lamps. The curve still returns a color there. It does not mean a real illuminant at 30000 kelvin looks like that hex in a room.

If you need the WCAG luminance of the resulting tint, copy the hex into the luminance page. If you need distance from another swatch, use CIE76 on the delta-E page. This converter only evaluates the approximation above. It does not invert hex back into a color temperature.

Privacy

Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.