How to use the Color Converter
- 1
Type or paste a colour in any CSS syntax, such as a hex code, rgb(), hsl(), hwb(), lab(), lch(), oklab(), oklch() or a name like rebeccapurple. The swatch and every format update as you type.
- 2
Copy any format with its copy button, or press Copy all to take the whole list.
- 3
Adjust the colour with sliders in RGB, HSL or OKLCH, and set the alpha. OKLCH keeps the perceived lightness steady while you change hue.
- 4
Check readability by entering a second colour under Contrast. The ratio and WCAG AA and AAA results update live.
- 5
Click any tint, shade or harmony swatch to make it the current colour, then press Copy link to share exactly what you see.
Features
- Reads every CSS colour syntax, including the modern space-separated forms and slash alpha
- Converts to HEX, HEX8, RGB, HSL, HWB, HSV, CMYK, Lab, LCH, OKLab and OKLCH, plus a Tailwind arbitrary value
- Colour maths follows CSS Color 4, with correct sRGB transfer, D50 Lab and the OKLab matrices
- Flags colours outside the sRGB gamut and shows the CSS gamut-mapped fallback
- Live sliders in RGB, HSL or OKLCH with an alpha slider
- WCAG 2 contrast checker with AA, AAA and large-text results
- Ten tints and shades in OKLCH lightness, plus complementary, analogous, triadic and split harmonies
- Shareable links that reopen the same colour, comparison colour and slider model
One colour, every format
Designers hand over hex codes, design tools export HSL, older stylesheets use rgba() with commas, and modern CSS increasingly uses OKLCH. Moving a colour between them by hand is tedious and easy to get wrong. Paste a colour in whatever form you have and this converter shows it in every format at once, each ready to copy, with the swatch, its nearest CSS name and a Tailwind arbitrary value.
The maths follows the CSS Color 4 specification rather than approximations. sRGB values are linearised with the proper transfer function, Lab and LCH use the D50 white point with Bradford adaptation as CSS requires, and OKLab uses Björn Ottosson’s published matrices. Pure red comes out as oklch(62.8% 0.2577 29.23), the same value browsers use.
Building palettes
The OKLCH sliders are the most useful way to adjust a colour. Lightness changes how light the colour looks without shifting its hue, and chroma controls how vivid it is. The tints and shades row steps lightness from almost white to almost black while keeping the hue, which is a quick way to build a 50 to 950 scale for a design system. The harmonies use OKLCH hue too, so a complementary pair has balanced perceived brightness.
Before you settle on text colours, use the contrast panel. It compares the current colour with a second one, white by default, and shows whether the pair passes WCAG AA and AAA for normal and large text.
Related tasks
To pick colours from a photo or screenshot instead, use the Color Picker from Image. For converting numbers between hexadecimal and other bases, the Number Base Converter handles values of any size.
Frequently asked questions
Which colour formats can I paste?
What is OKLCH and why use it?
What does out of gamut mean?
How is the contrast ratio calculated?
Why does CMYK not match my printer?
Is anything uploaded?
Last updated .