%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

HEX to RGB Converter (and RGB to HEX)

Results update as you type.

Your numbers

Understanding the HEX to RGB converter — concept and principle

Web colours are often written as HEX codes like #1E90FF, while design tools and CSS functions use RGB numbers like rgb(30, 144, 255). This converter goes both ways, supports short forms and an alpha (opacity) channel, and also shows the colour as a single 24-bit decimal number.

HEX to RGB pairs#1E90FF → RGB1E1×16 + 1430909×16 + 0144FF15×16 + 15255rgb(30, 144, 255)24-bit value 2,003,199
Each pair of hex digits is one channel from 0 to 255.

How it is calculated

#RRGGBB: each pair of hex digits is one channel from 00 (0) to FF (255)

Pair value = first digit × 16 + second digit (A = 10 … F = 15)

Short forms double each digit: #0AF = #00AAFF

Optional fourth pair = alpha, from 00 (transparent) to FF (opaque), shown as 0–1

RGB → HEX: write each 0–255 value as two hex digits

24-bit number = R × 65,536 + G × 256 + B

The principle

Hexadecimal is base 16, so two hex digits can represent 16 × 16 = 256 values, exactly the range of one 8-bit colour channel. That makes HEX a compact way to write the three bytes of a colour. The same bytes can be read as one 24-bit number with red in the high byte and blue in the low byte, which is how many programs store colours internally.

Worked example

Default input: HEX → RGB, #1E90FF.

  1. 1E = 1 × 16 + 14 = 30 (red).
  2. 90 = 9 × 16 + 0 = 144 (green).
  3. FF = 15 × 16 + 15 = 255 (blue).
  4. Result 30, 144, 255; CSS rgb(30, 144, 255); alpha 1 (no alpha pair).
  5. 24-bit number = 30 × 65,536 + 144 × 256 + 255 = 2,003,199.

How to read the result

Use whichever notation your tool needs; the colour is identical. When you need transparency, use the eight-digit form #RRGGBBAA or rgba(). The same values may look different on different screens because of display calibration and colour profiles.

Common mistakes

Keep in mind: Colour appearance depends on the display and colour profile. Check important brand colours on target devices.

Frequently asked questions

What does #FFF mean?

It is short for #FFFFFF, pure white.

How do I add transparency?

Use #RRGGBBAA, or rgba(r, g, b, a) with a between 0 and 1.

Is HEX case-sensitive?

No. #1e90ff and #1E90FF are the same colour.

What colour is #1E90FF?

A bright blue, known in CSS as "dodgerblue".

Sources: W3C, CSS Color Module Level 4: hexadecimal notation and the rgb()/rgba() functions

Checked 9 Nov 2026. W3C CSS Color Module Level 4: hexadecimal notation (#RGB, #RGBA, #RRGGBB, #RRGGBBAA) and the rgb()/rgba() functions.

💻 All tech & IT tools →🌍 Calculators by country →