← All tools

HEX, RGB, HSL, OKLCH and Contrast

Convert opaque HEX, RGB, HSL, OKLCH and named colors, then check WCAG contrast between a foreground/background pair.

color-converterLOCAL WORKSPACE

Enabling local controls…

Each field: 1 MiB UTF-8 (SQL: 100,000 characters); output: 2 MiB. Loading stops after 15 seconds; processing after 2 seconds. Local processing, without uploads or storage.

Supports opaque numeric HEX / RGB / HSL / OKLCH and named colors; alpha must be 1. CSS expressions and other color spaces are unsupported. OKLCH lightness is clamped to 0–1 and negative chroma to zero; achromatic hue displays as 0 (input none means 0). Out-of-sRGB input keeps its original OKLCH; HEX / RGB / HSL and preview use flagged channel clipping to 8-bit sRGB, not browser perceptual gamut mapping. CSS Color 4

Enter input or load a sample, then run.

If clipboard access is denied, select the read-only output manually.

WCAG 2.1 contrast

Accepts opaque HEX, RGB, HSL, OKLCH and named colors. Decisions use the unrounded ratio of converted8-bit sRGB colors; out-of-gamut colors use the converter's channel clipping. Does not assess gradients, transparency, images or a live page.

Normal text at16px.

Large bold text

21.000:1

  • AA normal ≥4.5: Pass
  • AA large ≥3: Pass
  • AAA normal ≥7: Pass
  • AAA large ≥4.5: Pass

How to use this tool

Enter a supported color or use the picker, convert and inspect the local swatch before copying HEX, RGB, HSL or OKLCH.

When not to use it

Alpha must be fully opaque. System/inherited colors and arbitrary CSS expressions are unsupported. Out-of-sRGB OKLCH retains its source notation; the preview and contrast use explicitly flagged8-bit sRGB channel clipping.