Hexadecimal colour codes pack three 8-bit values into six characters. Each pair of hex digits represents one channel — red, green and blue in that order — and each pair converts to a decimal number between 0 and 255. Reading them correctly is a routine need for anyone editing CSS, game assets or design tokens.
The conversion is positional, exactly like binary but with sixteen digits per place. Take #FF8C00: FF = 15×16 + 15 = 255, 8C = 8×16 + 12 = 140, 00 = 0. That gives rgb(255, 140, 0), the colour known as dark orange. The multiplier 16 on the first digit is the only thing to remember, and after a dozen conversions it becomes automatic.
Shorthand notation compresses repeated digits: #F80 is identical to #FF8800, because each digit is doubled. Modern CSS also accepts #FX (four digits) where the last is alpha, and eight-digit hex where the final pair carries opacity — #FF000080 is red at roughly 50% transparency, since 0x80 is 128 out of 255.
Convert any HEX color code into RGB and HSL values with a live preview. Supports 3-digit and 6-digit codes, and reverse RGB to HEX for CSS and design work.
Frequently Asked Questions
How do I read a hex colour code?
Split it into three pairs after the hash. The first pair is red, the second green, the third blue, each from 00 to FF. #00FF00 is pure green and #FFFFFF is white.
What does the alpha channel mean in an 8-digit hex code?
The final pair sets opacity on a 0–255 scale, where FF is fully opaque and 00 fully transparent. CSS also accepts a percentage alpha in rgba() syntax for the same effect.
Why do hex and rgb give different-looking results?
They should not. If they differ, check for a shorthand expansion error — #ABC is #AABBCC, not #A0B0C0 — or a colour profile applied by the design software.
Is hex exclusive to CSS?
No. It appears in Android resource files, Unity and Godot engine colour pickers, image editors and hardware specifications. The arithmetic is identical everywhere.