A quick reference for converting between the two most common color formats, plus what the numbers actually mean.
You'll run into this conversion constantly if you work with CSS: a designer hands you a HEX code, but the code you're editing already uses rgba() for transparency, or vice versa. Converting between the two is simple once you know what's actually happening under the hood.
A six-character HEX code like #2E42FF is really three two-character pairs — 2E, 42, and FF — one for each of red, green, and blue. Each pair is a base-16 (hexadecimal) number from 00 to FF, which is the same range as 0-255 in the more familiar base-10 numbers RGB uses.
You can do this by hand with a base conversion chart, but it's easy to make a mistake, and there's no reason to when a tool can do it instantly. The HEX to RGB tool converts any valid HEX code and shows the R, G, and B values individually plus the CSS rgb() value ready to paste.
If you're starting from RGB values and need a HEX code instead — say, you have specific numbers from a design spec — the RGB to HEX tool handles that conversion just as directly.
If you also need HSL, HSV, or CMYK values for the same color, the Color Converter shows every format at once from a single input, which saves converting the same color multiple times through different tools.
3-digit HEX shorthand like #24F is valid CSS and expands to #2244FF — each character is duplicated. Most HEX-to-RGB tools accept both the 3- and 6-digit forms.
HEX is base 16, so after 0-9 it continues with A-F to represent values 10-15. That's why a HEX pair can go up to FF (255) instead of stopping at 99.
Yes — both represent pure white. They're just two different ways of writing the identical color.
8-digit HEX codes (like #2E42FFCC) include an alpha channel as the last pair, which converts to the 'a' in rgba() — standard 6-digit HEX has no transparency information.
You don't need a trained eye to pick colors that work together. You need to know a handful of relationships on the color wheel.
Three terms designers use constantly and mix up just as often. Here's the precise difference, with a clear way to remember it.
Two nice colors and a straight blend between them can still come out looking gray and lifeless in the middle. Here's why, and the fix.
Turning one color you like into a full, working set — text, background, accents, and everything that needs to pair with it.