OKLab ΔE (ΔEOK) calculator
Paste two sRGB hex codes and get their ΔEOK, the straight-line distance between them in OKLab: #000000 against itself gives 0, and the further apart the colors, the larger the number. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Hex1
- #000000
- Hex2
- #000000
- Decimal places
- 6
- Delta e ok
- 0
Euclidean distance in OKLab between two sRGB hex colors. Search intent: OKLab delta E calculator. No network calls or random seeds are required. Failed jobs are not billed.
A single distance between two colors
OKLab describes each color with three numbers: L for lightness, and a and b for two color axes. ΔEOK, also called delta E OKLab, treats those three numbers as a position and measures the straight line between two positions. Enter two sRGB hex colors, the same codes you would copy from a design file or a style sheet, and the calculator converts both to OKLab before measuring. When the two codes are the same, as with #000000 and #000000, the distance is 0. The more the lightness, hue or intensity of the colors drift apart, the larger the result.
How it is worked out and when to use it
The calculation subtracts the L, a and b values of the second color from those of the first, squares each difference, adds the three squares and takes the square root. Because each difference is squared, swapping the two colors gives the same answer. You can set how many decimals to keep; rounding is applied once to the full result. Use it to check whether two versions of a brand color still match, to space out shades in a palette or to spot near-duplicates in a list of colors. A common mistake is to compare this number with ΔE values from other formulas: each one has its own scale, so set tolerances with the same formula throughout.
What you can do with it
Teaching
Pinned goldens.
FAQ
What does delta E OKLab measure?
It measures how far apart two colors are in the OKLab color space. The tool converts both sRGB hex colors to OKLab and returns the straight-line distance between them, so identical colors give 0.
What is the ΔEOK formula?
ΔEOK is the square root of ΔL² + Δa² + Δb²: take the difference in lightness L and in the a and b color axes, square each one, add them and take the square root.
Which colors can I compare?
Two colors written as sRGB hex codes, such as #000000. Enter the first and the second color; the order does not change the distance, because the formula only uses squared differences.
Can I round the result?
Yes. Choose the number of decimals, for example 6. Rounding happens once, with halves going up, on the unrounded distance.
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/delta-e-ok \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"hex1":"#ff0000","hex2":"#00ff00"}'const res = await fetch("https://api.kit.forhosting.com/color/delta-e-ok", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"hex1": "#ff0000",
"hex2": "#00ff00"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/color/delta-e-ok",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"hex1": "#ff0000",
"hex2": "#00ff00"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/color/delta-e-ok", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"hex1":"#ff0000","hex2":"#00ff00"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"hex1":"#ff0000","hex2":"#00ff00"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/color/delta-e-ok", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"hex1": "#ff0000",
"hex2": "#00ff00"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "color.delta_e_ok",
"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
The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS hooks, automation, or teaching demos.
How it works
Euclidean distance in OKLab between two sRGB hex colors. ΔEOK = √(ΔL²+Δa²+Δb²) in OKLab. No network calls or random seeds are required. Failed jobs are not billed. No network calls or random seeds are required. Failed jobs are not billed. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS hooks, automation, or teaching demos. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS hooks, automation, or teaching demos.
Inputs, limits and rounding
Optional decimals use half-up once. Optional output fields are omitted, never null. No network calls or random seeds are required. Failed jobs are not billed. No network calls or random seeds are required. Provide required JSON fields with DOM-safe names. Invalid types raise invalid_input. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS hooks, automation, or teaching demos. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS hooks,
When to use it
Use when search intent matches. Euclidean distance in OKLab between two sRGB hex colors. EN-only delivery; Nitro hydrates locales. No network calls or random seeds are required. Failed jobs are not billed. No network calls or random seeds are required. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS hooks, automation, or teaching demos. The calculator is free in the browser, deterministic, and identical on the API path. Inputs are validated before arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE values when decimals are requested. Use the same JSON from spreadsheets, CMS hooks, automation, or teaching demos.
Integration use cases
Quick check
Free widget.
Automation
API same JSON.
Technical questions
Free?
Yes tier A.
Network?
No.
Bad input?
invalid_input.
API?
Yes.
Locales?
EN-only; Nitro hydrates.