Color Converter

Pick a color and read it as HEX, RGB and HSL at once, with a tint and shade ramp and a WCAG contrast check against white and black.

100% local

Everything runs locally in your browser. Your files are never uploaded to any server.

No account, no queue, no file size limit imposed by a server. You can confirm this in your browser's Network panel while the tool works.

RGB —
HSL —
CSS variables —
Tints and shades
Contrast on white
—
Contrast on black
—

How to use this tool

The three notations describe the same color in different ways. HEX is how CSS and design tools write it, RGB is what canvas and image APIs consume, and HSL describes hue, saturation and lightness — which is the useful one when you need to build a palette, because you can shift lightness by a fixed step and keep the ramp visually even.

Watch out for two conversions that lose information silently. HEX can only express sRGB, so any Display P3 color from a modern design file will be clamped when converted. Round-tripping HSL through RGB also loses precision, because HSL is a polar transform of a quantised cube; expect a value or two of drift per channel and do not treat it as a bug.

Contrast is the part that affects people. WCAG 2.2 asks for 4.5:1 for normal body text and 3:1 for large text or UI borders; the ratio is computed from relative luminance, not from how different the colors look to you. Pure black on a mid blue can pass while a pair that looks obviously distinct fails, which is why every serious design system checks the number instead of trusting the eye.

Frequently asked questions

What is the difference between HSL and HSB?

Both use hue and saturation but differ in the third axis: HSL measures lightness from black to white, HSB (or HSV) measures brightness with full saturation at the top. CSS uses HSL.

Why does my HEX value change after converting?

Rounding. RGB channels are integers from 0 to 255, so a conversion through HSL can land one unit off. The visual difference is imperceptible.

What contrast ratio do I need?

4.5:1 for body text, 3:1 for text at 24px or larger and for meaningful UI boundaries. AAA asks for 7:1 on body text.

Does this support transparency?

The converter works on opaque colors. For alpha, add an eighth pair of hex digits or use rgba() in your stylesheet.

Related tools