๐Ÿ”’ Runs in your browser

Your input stays in your browser. Nothing is uploaded and there is no account to create.

Color Converter

Convert between HEX, RGB and HSL, preview a color and check white / black text contrast.

Loading...

Share This

Found this useful? Share it with your friends.

Converts a colour between HEX, RGB and HSL, and โ€” more usefully โ€” tells you whether white or black text is readable on top of it. Input is either a hex value (#abc or #aabbcc) or an rgb() string, and the swatch strip jumps to eight common values if you only want a starting point.

The distinction that trips people up: HEX is what CSS and design tools store, RGB is what eyedroppers and image editors give you, and HSL is the one you can reason about. To make a colour lighter you raise the third number; to shift its family you change the first. Doing the same by editing hex digits means guessing. All three are shown at once so you can move between the mental models without opening a second tool.

The contrast readout follows the WCAG relative-luminance formula, the same calculation browsers and accessibility checkers use: each channel is converted to linear light, weighted 0.2126 / 0.7152 / 0.0722, and the ratio between text and background is (L1 + 0.05) / (L2 + 0.05). 4.5:1 is AA for normal text, 3:1 is AA for large text, and 7:1 is AAA. The tool names whichever of white or black wins and says whether it clears AA โ€” so a mid-tone brand colour that looks fine in a mockup but scores 3.1:1 is visible before it ships.

It converts but does not measure alpha: rgba() input is accepted and the alpha component ignored, and there is no 8-digit hex support. For translucent colour work, use a browser's own picker.

More free browser tools

See all Playground apps โ†’

๐Ÿ’ฌ Share Your Feedback

Found a bug, or have an idea for a tool that should be here? We'd love to hear from you.

Send us an email with your feedback or suggestions. We read every message.

๐Ÿ“งSend Feedback via Email

All Playground apps are free to use, with no account required.