Convert HEX colours to every CSS format a developer needs: RGB, RGB percentages, HSL, HSLA, RGBA, 8-digit HEX, and CSS variables. Includes WCAG contrast checker, nearest CSS named colour match, recent colours history, URL sharing, channel breakdown, and live preview. Free, private, no signup.
1. Colour Input HEX · Picker · RGB sliders
2. CSS-Ready Code Click any Copy button
3. Channel Breakdown Values & percentage ranges
| Channel | Value | Percentage | CSS Range |
|---|
4. Accessibility — WCAG Contrast AA / AAA checker
5. Colour Variations Click to load into editor
One HEX code. Nine CSS formats. Zero guessing.
You have a HEX colour. You need it as rgb() for one project. As hsl() for another. As a CSS variable for your design system.
Most converters give you one format. You copy. You convert again. You repeat.
This tool gives you every format at once. RGB, RGB percentages, HSL, HSLA, RGBA, 8-digit HEX, and CSS variables.
Each one has its own copy button. Paste it where you need it. Done.
What you get
HEX. The base format. #059669.
HEX + Alpha. 8-digit version. #059669FF. The last two digits control opacity.
RGB. Classic syntax. rgb(5, 150, 105). Three channels from 0 to 255.
RGB Percentages. Modern syntax. rgb(2% 59% 41%). Same colour, different notation.
RGBA. RGB with alpha. rgba(5, 150, 105, 0.80). Alpha runs from 0 to 1.
HSL. Hue, saturation, lightness. hsl(161deg 94% 30%). Easier for colour variations.
HSLA. HSL with alpha. hsla(161, 94%, 30%, 0.80).
CSS Custom Property. --brand-color: #059669;. Ready for your design system.
CMYK. For print. cmyk(95% 0% 30% 41%). Not supported in CSS. Useful for design handoff.
Why HSL beats RGB for colour work
RGB has three independent channels. Change one and you change the colour in a way that is hard to predict.
HSL separates hue from lightness. Want a darker shade? Lower the L value. Want a muted version? Lower the S value.
The hue stays the same. That makes HSL the better choice for building colour systems.
This tool shows you both. You decide which works for your project.
WCAG contrast checker
Every colour needs to pass accessibility standards. WCAG defines three thresholds.
4.5:1 for normal text (AA). 7:1 for enhanced contrast (AAA). 3:1 for large text and UI components.
The tool calculates the contrast ratio against both white and black backgrounds. Each gets a grade.
If your colour fails, you know before you ship. No surprises in an accessibility audit.
Nearest CSS named colour
Sometimes you need a named colour. Not a HEX code.
The tool finds the closest match from the 148 CSS named colours. It uses redmean distance, which is more accurate than simple RGB distance.
You see the name, the HEX value, and the distance score. If the match is close, you can use the name in your CSS.
Colour variations and harmonies
The tool generates ten variations from any colour. Lighter and darker shades. Complement. Analogous. Triadic.
Click any swatch to load it into the editor. The tool recalculates everything.
This is useful for building palette ramps or exploring colour combinations.
Recent colours and sharing
Every colour you use is saved to a recent list. Up to ten colours. Click a chip to reload it.
The "Copy shareable link" button gives you a URL. It contains the current colour and alpha. Share it with a teammate or bookmark it.
When someone opens the link, the tool loads that exact colour. No manual entry.
Privacy and speed
Everything runs in your browser. No uploads. No accounts. No ads inside the tool.
Recent colours and your last-used value are saved in localStorage on your device. Clear your browser data and they are gone.
Use it for quick conversions or full colour exploration. The numbers never leave your machine.
Frequently Asked Questions
How do I convert HEX to RGB in CSS?
#059669 becomes rgb(5, 150, 105). The tool does this automatically and gives you the CSS declaration ready to paste.What is the difference between HSL and RGB?
How is the WCAG contrast ratio calculated?
(L1 + 0.05) ÷ (L2 + 0.05). L1 is the lighter relative luminance. L2 is the darker. Relative luminance is computed from sRGB values with gamma correction. 4.5:1 passes AA for normal text. 7:1 passes AAA.