Color Converter: HEX, RGB, HSL, OKLCH and Contrast
Convert colours between HEX, RGB, HSL and OKLCH.
Type a colour any way CSS writes one (#1F6B4A, rgb(31 107 74), hsl(154 55% 27%), oklch(…), or a name) into any of the fields, pick one, take one from the screen where the browser can, or paste one anywhere in the window, and every other field follows. The arrow keys step the number under the cursor (Shift for ten). Lightness, strength and hue move the colour as the eye sees it (OKLCH), and the strip of shades under it gives lighter and darker ones. The two cards show the colour as text on white and on black with its WCAG contrast ratio: 4.5 to 1 is the minimum for body text (AA), 3 to 1 for large text.
How to use Colour converter
- Type or paste a colour into HEX, RGB, HSL or OKLCH, or press Pick to choose one.
- Move Lightness, Strength and Hue, or take a lighter or darker shade from the strip.
- Press the copy button beside the format you need.
Colour converter: common questions
Does the colour converter send anything to a server?
No. The colour converter does every conversion in your browser, on your device, and makes no request. It works offline too.
Does the colour converter keep transparency (alpha)?
Yes. The colour converter reads an alpha value in hex (#rrggbbaa) and in rgb(), hsl(), hwb() and oklch(), and writes it in every format whenever it is not 1.
What happens to an OKLCH colour outside the sRGB range?
The colour converter works in sRGB, so an OKLCH colour outside it is cut to sRGB channel by channel, and HEX, RGB and HSL show the colour that results.
Everything stays on your device. Nothing is uploaded. Works offline once your first visit has stored the app.