Contact

Tools  /  Colour  /  HEX → RGB

HEX → RGB

Turn a hex colour into RGB and rgba values.

What this tool does

Converts a colour between hex and RGB in both directions, accepting 3, 4, 6, or 8-digit hex, rgb()/ rgba(), plain R G B numbers, or a CSS colour name as input — with per-channel sliders, an alpha channel, and several colour-relationship tools built in.

Flexible input parsing

Paste a hex code in any length CSS actually supports (3-digit shorthand, 4-digit with alpha, 6-digit, or 8-digit with alpha), an rgb()/rgba() function, three bare numbers, or a CSS colour name like coral — all parse into the same underlying colour.

Shorthand and name detection

When the current colour has a valid 3-digit shorthand (each channel's two hex digits match), it's shown and clickable; when the exact colour matches a known CSS colour name, that name is shown too — useful for knowing when a shorter or more readable form is available instead of always outputting the full 6-digit hex.

Colour wheel, eyedropper, and harmonies

Drag the hue wheel or use the browser's screen eyedropper to pick a colour directly. Four colour harmony types — complementary, analogous, triadic, and split-complementary — are generated from the current hue, each swatch clickable to jump to that colour.

Tint/shade scale and WCAG contrast

An 11-step lightness scale shows the current hue from near- black to near-white, and the contrast ratio against both black and white text is calculated and graded against real WCAG AA/AAA thresholds.

Getting it out

Copy the hex, rgb()/rgba(), hsl(), or bare "R G B" form with one click.

Privacy

Everything runs locally in your browser -- nothing you pick or type is sent to a server.

Frequently asked questions

Is my data uploaded anywhere?
No. Every conversion runs entirely in the browser -- nothing is sent to a server.
What hex formats can I paste in?
3-digit shorthand, 4-digit with alpha, 6-digit, and 8-digit with alpha are all accepted, along with rgb()/rgba(), bare "R G B" numbers, and CSS colour names.
Does it tell me if a shorter hex code is available?
Yes -- when the current colour's 6-digit hex has each channel's two digits matching, a clickable 3-digit shorthand version is shown alongside it.
What are colour harmonies, and how are they generated?
Complementary (180° opposite), analogous (adjacent hues), triadic (evenly spaced three-way), and split-complementary are all computed from the current hue on the colour wheel -- standard colour theory relationships useful for building a coordinated palette.
Can I pick a colour from anywhere on my screen?
Yes, in browsers that support it -- the eyedropper button opens the browser's own screen colour picker.
Does it check contrast for accessibility?
Yes -- the contrast ratio against both black and white text is calculated and graded against the real WCAG AA/AAA thresholds.
Theme Accent