Convert color temperature to RGB
See how a light temperature looks on screen. 6500 K gives red 255, green 254 and blue 250, written #fffefa. Warm values lean orange, high ones turn blue, and the same input always returns the same color. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Creativity
- 6,500
- Kelvin
- 6,500
- Hex
- #fffefa
Convert a color temperature in Kelvin into an approximate RGB color for lighting previews, interface themes, photography tools, and data displays. Enter any finite temperature from 1000 K through 40000 K and receive integer red, green, and blue channels plus a convenient hexadecimal color. The calculator uses a deterministic blackbody curve approximation, so the same input always produces the same result. It is useful when a practical screen color matters more than a full spectral simulation or color-managed rendering pipeline.
What a Kelvin color temperature means
Color temperature describes the apparent hue of light by comparing it with the color emitted by an ideal heated blackbody. Lower values in the supported range look warm: they emphasize red and orange, much like candlelight, firelight, or a traditional tungsten lamp. Values around common daylight settings appear more neutral, while higher values shift toward cool blue.
This converter accepts temperatures from 1000 K to 40000 K, inclusive, and maps that physical idea to an approximate screen color. The result contains integer red, green, and blue channel values between 0 and 255, along with the corresponding hexadecimal notation. Kelvin is not brightness, exposure, saturation, or lamp power, so changing the temperature does not say how intense a source should be.
It only supplies a useful chromatic estimate.
How the blackbody approximation is calculated
The calculation first divides the Kelvin value by one hundred, then applies a standard piecewise curve fit to each sRGB channel. At warmer temperatures, red remains at full strength while green follows a logarithmic curve. Blue stays at zero near the lowest part of the range and then rises logarithmically.
Above the daylight region, blue reaches full strength while red and green use power curves that gradually decrease. Every computed channel is clamped to the valid byte range and rounded to the nearest integer. The three bytes are also formatted as a six-digit hexadecimal color.
This approach is deterministic, quick, and suitable for user interfaces, previews, charts, and automation. It does not numerically integrate Planck's law, apply a color matching function, adapt a white point, or use a monitor ICC profile. Consequently, the returned RGB should be understood as an established practical approximation rather than laboratory-grade colorimetry.
Repeating a request with the same numeric temperature will always return exactly the same channels.
Using the result accurately in a project
Choose a Kelvin value that matches the lighting concept you want to communicate, submit it, and use either the channel object or the hex string in your application. A warm indoor preview might begin near 2700 K, a daylight-oriented control may begin near 6500 K, and a cool stylized scene can use a larger value. Test the resulting color in the actual interface because a small swatch, a full background, and an additive light effect can look very different.
If you are matching real equipment, compare the preview with manufacturer data and a calibrated workflow; lamps with the same correlated color temperature may have different spectra and may render surfaces differently. Inputs below 1000 K or above 40000 K return an invalid-input error instead of silently clamping, which helps catch unit mistakes and bad upstream data.
What you can do with it
Preview smart-light settings
Turn a bulb's Kelvin setting into a representative RGB swatch for a lighting control interface.
Build photography controls
Show an approximate warm-to-cool color beside white-balance temperature values in a camera or editing tool.
FAQ
Is the result physically exact?
No. It is a practical blackbody-to-sRGB curve approximation, not a spectral simulation or calibrated measurement.
Why can two lamps with the same Kelvin value look different?
Correlated color temperature does not fully describe a lamp's spectrum, color rendering, intensity, or the viewing environment.
Does a higher Kelvin value make the color brighter?
No. Kelvin describes the hue of light, not its brightness, exposure, saturation or lamp power. Raising the value shifts the color from warm orange toward cool blue without saying how intense the source should be.
Can I enter a temperature in Celsius or Fahrenheit?
No, the value must be in Kelvin, from 1000 to 40000 K. If your readings come from a sensor or a spreadsheet, check they are Kelvin first, because a Celsius figure would give a misleading color.
Will the same Kelvin value always give the same color?
Yes. The conversion follows a fixed blackbody curve approximation, so 6500 K returns #fffefa every time. That keeps themes and charts consistent when the same light temperature appears in many places.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/color/temperature-kelvin-to-rgb \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"temperature":6500}'const res = await fetch("https://api.kit.forhosting.com/color/temperature-kelvin-to-rgb", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"temperature": 6500
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/color/temperature-kelvin-to-rgb",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"temperature": 6500
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/color/temperature-kelvin-to-rgb", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"temperature":6500}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"temperature":6500}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/color/temperature-kelvin-to-rgb", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"temperature": 6500
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "color.temperature_kelvin_to_rgb",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Using the result accurately in a project
For API automation, validate that your source is sending Kelvin rather than Celsius or Fahrenheit. Each API request uses the published base price of $0.002, while browser execution can support quick interactive checks.
Integration use cases
Color-code temperature data
Generate consistent RGB and hex values for diagrams, reports, fixtures, or datasets that store color temperature.
Technical questions
What input range is supported?
The temperature must be a finite number from 1000 K through 40000 K, including both endpoints.
What does an API conversion cost?
The base price is $0.002 per request.
What happens when the value is outside the range?
The capability returns an invalid_input error instead of clamping the value to the nearest supported temperature.