Color Converter — HEX, RGB, HSL, OKLCH, LAB, CMYK & Tailwind
Convert any color between every common format — HEX, RGB(A), HSL(A), HSV/HSB, HWB, CMYK, LAB, LCH, OKLAB, OKLCH, XYZ, CSS named colors and Tailwind classes. Build palettes, check WCAG & APCA contrast, simulate color blindness, mix colors, eyedrop from images and export to CSS / Tailwind / SCSS / SwiftUI / Android / Flutter. 100% client-side.
Web
Print & legacy
Perceptual & CIE
Native frameworks
Approximate simulation using the Brettel/Viénot LMS-projection method. About 8% of men and 0.5% of women have some form of color vision deficiency.
All the ways this color converter works
Everything below runs locally in your browser — there is no server round-trip and your colors never leave the device. The same canonical sRGB triplet is the source of truth: every output, palette, contrast check and code snippet is recomputed from it whenever you tweak a slider, paste a value or pick a pixel.
#f80, #f80c, #ff8800, #ff8800cc — short, alpha-short, classic and alpha-classic.
Both legacy rgb(255,136,0) and modern CSS Color 4 rgb(255 136 0 / .8) syntax.
Hue / Saturation / Lightness — easy to tweak by hand.
The model used in Photoshop, Sketch and Figma color pickers.
Hue + Whiteness + Blackness — the natural mental model for tints & shades.
Subtractive color for print mockups (uncalibrated, no ICC profile).
D65 white point, computed via XYZ — the standard perceptual space since 1976.
Modern perceptually-uniform space (Ottosson 2020) — what CSS Color 4 recommends.
CIE 1931 tristimulus values, the bridge between RGB and every perceptual space.
All 147 CSS Color 4 names — and the closest match for any custom color.
242 default Tailwind shades — the closest utility class for any color.
Color(red:green:blue:opacity:) snippets ready to paste.
0xAARRGGBB long literal and <color> resource format.
Color(0xFFRRGGBB) with alpha-aware output.
Matplotlib-style tuples and Pillow (R,G,B) integers.
Tints, shades, tones, complementary, analogous, triadic, tetradic, split, monochromatic + an OKLCH lightness ramp.
Pass / fail for AA & AAA, normal & large text, plus the UI components 3:1 threshold.
The accessible perceptual contrast metric proposed for WCAG 3 — better for dark mode.
Protanopia, deuteranopia, tritanopia & achromatopsia previews of your color and palette.
Blend two colors with an adjustable ratio — see both naive sRGB and perceptual OKLCH mixes.
Upload any image and click to extract the exact pixel color — keeps a recent-picks strip.
In Chrome / Edge 95+, pick a color from anywhere on screen — full OS desktop, not just the page.
Your color is encoded in the page hash (#c=3b82f6) so the link always opens the same swatch.
Paste any format — short hex, oklch, named, legacy rgb — the tool figures it out.
Why bother with anything beyond HEX?
HEX and RGB are great for storage but terrible for design. Try writing a "20% lighter, slightly more saturated" version of #3b82f6 in your head — you can't. In HSL it is just hsl(217 92% 80%). In OKLCH it is even more reliable, because OKLCH lightness matches human perception, while HSL lightness famously does not (a yellow at 50% L looks much brighter than a blue at 50% L). Picking the right space for the job is what makes a palette look intentional instead of accidental.
The color spaces, in one paragraph each
Who this tool is for
Translate Figma swatches into Tailwind, SwiftUI or CSS without round-tripping through Photoshop.
Quick HEX → OKLCH conversion, contrast checks, and ready-to-paste CSS variables.
Get the exact 0xFFRRGGBB literal for SwiftUI, Compose, Flutter or XML.
WCAG 2.1 + APCA verdicts, plus a color-blindness simulator — all in the same view.
Quick CMYK approximations and L*a*b* values for ink-spec discussions.
Generate perceptually-uniform OKLCH ramps for sequential and diverging palettes.
Eyedrop colors out of a brand image and snap them to the closest Tailwind class.
See how all the spaces relate — every conversion is recomputed live as you drag a slider.
Frequently asked questions
What's the difference between HEX, RGB and HSL?
All three describe the same sRGB color. HEX (#3b82f6) is hex shorthand for the RGB channels. RGB writes those channels as 0–255 numbers. HSL describes the same color as Hue, Saturation and Lightness — much easier to tweak by eye.
What is OKLCH and why should I use it?
OKLCH is a perceptually uniform color space — equal numeric steps look equally large. Unlike HSL, two OKLCH colors at the same Lightness really do appear equally bright. Modern browsers support oklch() natively.
How do I check if my text is accessible?
Open the Contrast tab. It calculates the WCAG 2.1 ratio between your foreground and background and flags AA / AAA pass for normal and large text. It also shows the APCA Lc value, the contrast metric proposed for WCAG 3.
What is the closest Tailwind class for my color?
The pill near the sliders shows the closest match in the default Tailwind v3 palette (22 colors × 11 shades = 242 entries) by Euclidean distance in sRGB.
Is the CMYK output print-ready?
No. The conversion is the simple math sRGB → CMYK formula. True print color requires an ICC profile for the specific paper and press. Use the CMYK output as a rough starting point only.
Does this tool send my colors anywhere?
No. All conversions, palette generation and image picking happen in your browser. The image picker reads pixels via a canvas in memory and discards the bitmap when you leave the page.
What is APCA?
APCA (Accessible Perceptual Contrast Algorithm) is the contrast metric proposed for WCAG 3.0. Rule of thumb: |Lc| ≥ 75 for body text, ≥ 60 for large text, ≥ 45 for UI elements.
Can I share a color via URL?
Yes — the page hash updates to #c=rrggbb as you tweak the color. Click the Share button to copy the link.