Convert HEX to RGB
Type in either box and the other follows. Alpha, HSL, and the contrast figure you are supposed to check before shipping the colour.
Contrast ratios appear here as you change the colour.
What the six digits actually mean
A hex colour is three numbers wearing a disguise. #0D9488 is 0D, 94 and 88 — the red, green and blue channels written in base 16, each running from 00 to FF, which is 0 to 255 in the decimal you already use. That is the entire conversion. 0D is 13, 94 is 148, 88 is 136, and rgb(13, 148, 136) is the same colour by a different name.
Hex exists because it is compact and because CSS inherited it from an era when every byte in a stylesheet was argued over. RGB exists because it is readable and because you can do arithmetic on it. Most codebases end up carrying both, which is why the conversion keeps coming up.
The short forms, and the fourth pair
Three-digit hex is a shorthand: each digit is doubled, so #0C9 means #00CC99. It can only express 4,096 of the 16.7 million available colours, which is why you rarely see it outside quick sketches.
Eight-digit hex adds an alpha pair on the end. #0D9488CC is the same teal at CC — that is 204, or 80% opacity. Every current browser supports it, which makes it a tidier option than rgba() when you only need one value. This page accepts all four lengths in the hex box and will emit the eight-digit form as soon as you move the alpha slider below 100%.
Why HSL is on the list
HSL describes the same colour as a hue angle, a saturation percentage and a lightness percentage. It is useless for storage and excellent for reasoning: to build a hover state you nudge the lightness down five points and leave hue and saturation alone. Doing the equivalent in hex means changing all six digits and hoping. If you are constructing a palette rather than transcribing one, work in HSL and convert at the end.
The contrast number
Under the swatch is the contrast ratio of this colour against white and against black. WCAG asks for at least 4.5:1 for body text and 3:1 for large text or interface components. It is worth checking at the moment you pick a colour rather than during an accessibility audit six months later — most failures are brand colours used as text on white, and they are far cheaper to fix before anything is built on top of them.
Note that the ratio is computed against a solid background. If you drop the alpha below 100%, the effective contrast depends on whatever is behind the element, and the figures shown no longer describe what a user will see.
Nothing here is sent anywhere
The conversion is arithmetic — a few lines of it — and it runs in the page. There is no request, no logging and no analytics on this site at all. If you need to encode an image for a stylesheet rather than a colour, the image to Base64 tool works the same way.
Common questions
How do I convert HEX to RGB by hand?
Split the six digits into three pairs and read each as base 16. The first digit is worth 16 times its value, the second is worth its face value: A3 is (10 × 16) + 3 = 163. Do that three times and you have red, green and blue.
What does the fourth pair in an 8-digit hex mean?
Alpha — opacity from 00 (fully transparent) to FF (fully opaque). #FF000080 is red at roughly 50%. Every modern browser supports the notation; only Internet Explorer never did.
Does #ABC mean the same as #AABBCC?
Yes. Three-digit hex doubles each digit. It cannot express colours whose pairs differ, so it covers 4,096 shades rather than 16.7 million.
Is RGB different from RGBA?
Only in that RGBA carries a fourth value for opacity, given as a decimal between 0 and 1 rather than a hex pair. rgb(13, 148, 136) and rgba(13, 148, 136, 1) are identical.
Why show HSL as well?
Because it is the notation you can reason about. Hue, saturation and lightness map onto how people actually describe colour, so deriving a hover or disabled state is a single adjustment rather than six digits of guesswork.
What is the contrast ratio for?
It is the WCAG accessibility measure. Body text needs 4.5:1 against its background, large text and UI components need 3:1. The figures update as you type, against both white and black.
Are my colour values sent to a server?
No. The maths runs in your browser. The page makes no network requests after it loads and the site carries no analytics.