Skip to content
MewixMewix

HEX to RGB

Paste a HEX code to get its RGB values, ready to copy as rgb() or plain numbers.

Updated by the Mewix team

How HEX becomes RGB

A HEX code is three pairs of characters: red, green and blue. Each pair is a number from 0 to 255 written in base 16, where the digits run 0–9 then A–F (A = 10, F = 15). To convert a pair by hand, multiply the first character by 16 and add the second.

#2563EBPairSumValue
Red252 × 16 + 537
Green636 × 16 + 399
BlueEB14 × 16 + 11235

So #2563EB is rgb(37, 99, 235). The highest pair tells you the dominant channel: here blue, at almost full strength.

Three-digit shorthand

CSS allows a 3-digit HEX code when each pair is a repeated character. #F0A means #FF00AA, which is rgb(255, 0, 170). The converter expands it for you.

Questions

Is HEX case-sensitive?

No. #2563eb and #2563EB are the same colour. The converter shows capitals.

My HEX code has 8 digits.

The last two digits are opacity (alpha). Remove them to convert the colour; 80 means about 50 percent and CC about 80 percent.

Can I check if the colour is readable on white?