Colour Converter & Contrast Checker
Convert between HEX, RGB, HSL, HSV and CMYK, and see immediately whether black or white text is readable on the result.
Preview
Contrast and accessibility
About this colour
Every format
Conversion and contrast measurement both happen in your browser. Nothing you enter is uploaded.
What It Does
Paste a colour in whatever form you have it — a hex code, an rgb() string from a design tool, an hsl() value from a stylesheet, or a CSS name — and get every other representation back, along with a live preview. The part that earns the page is what comes after the conversion. Every colour is measured against black and white text using the WCAG contrast formula, so you find out immediately whether the shade you have chosen can actually carry readable text, and which of the two to use. That answer is frequently not the one intuition gives: colours that look dark often take black text better than white, because the green channel dominates measured luminance in a way the eye does not report. Everything runs in your browser, so a palette in progress stays on your machine.
When to Use It
- A designer handed you hex codes and your stylesheet is written in HSL, so you need the equivalents without opening a design tool.
- You are choosing a button colour and need to know whether the label should be black or white before committing to it.
- An accessibility audit flagged a component and you want the actual contrast ratio rather than a pass or fail.
- You are building a palette and want to see how a hue behaves across saturation and lightness in a form you can paste into CSS.
- A brand guide gives CMYK values and you need something approximate to work with on screen.
Worked Examples
#3b82f6
The counter-intuitive case, and the reason the contrast panel exists. This blue reads as dark, but black text gives 5.7:1 on it against white's 3.7:1 — so the instinctive choice of white text is the worse one.
rebeccapurple
A CSS colour name, which converts to #663399. Dark enough that white text is clearly correct here, and the panel confirms it comfortably clears the AA threshold for body text.
hsl(45 100% 51%)
A saturated yellow written in the modern space-separated syntax. Very high measured luminance, so black text is the only workable choice — white on yellow fails badly despite being a common design instinct.
Features
How to Use
1. Paste or type a colour in any supported format, or use the picker to choose one visually. 2. Every other representation appears immediately, each with its own copy button. 3. The preview shows the colour with both black and white sample text on it. 4. Read the contrast panel for the ratio against each and the recommended choice. 5. Click any copy button to take that format.
Common Mistakes
- Choosing text colour by eye. Perceived brightness and measured luminance diverge sharply for saturated colours, and blues in particular take black text far better than they look like they should.
- Treating a 3:1 ratio as good enough for body text. That threshold is for large text only — 18pt and above, or 14pt bold. Ordinary paragraph text needs 4.5:1.
- Converting HSL back and forth and expecting the hex to survive. The displayed HSL values are rounded for readability, so a round trip can drift by a shade.
- Sending arithmetic CMYK values to a printer. Real print conversion needs the press's ICC profile; these numbers are for on-screen approximation only.
- Forgetting that a translucent colour's contrast depends on what is behind it. An rgba value over a patterned or coloured background can be far less readable than the figures for a flat backdrop suggest.