HEX to RGB Converter

Enter a three- or six-digit HEX color, with or without #. The converter expands shorthand, validates the code, and shows its RGB channels immediately.

Everything runs locally in your browser.

RGB result
rgb(255, 87, 51)
Normalized HEX: #FF5733

How HEX becomes RGB

A six-digit HEX color uses three hexadecimal pairs in the order red, green and blue: #RRGGBB. Each pair ranges from 00 (decimal 0) to FF (decimal 255).

  1. Remove the optional #.
  2. Split the code into red, green and blue pairs.
  3. Convert each pair from base 16 to base 10.

For #FF5733: FF = 15 × 16 + 15 = 255, 57 = 5 × 16 + 7 = 87, and 33 = 3 × 16 + 3 = 51. The result is rgb(255, 87, 51).

What is three-digit shorthand HEX?

CSS allows #RGB when each channel repeats the same digit. Expand each digit before converting: #F53 becomes #FF5533. It does not mean #0F0503. Not every six-digit color can be shortened—only codes such as #AABBCC where both digits in every pair match.

Common HEX to RGB colors

ColorHEXRGB
Black#000000rgb(0, 0, 0)
White#FFFFFFrgb(255, 255, 255)
Red#FF0000rgb(255, 0, 0)
Lime#00FF00rgb(0, 255, 0)
Blue#0000FFrgb(0, 0, 255)
Gold#FFD700rgb(255, 215, 0)
Slate blue#6A5ACDrgb(106, 90, 205)

HEX to RGB questions

Do I need to type the hash symbol?

No. Both FF5733 and #FF5733 are accepted and normalized to the same result.

Does this converter support transparency?

This page converts solid three- and six-digit HEX colors. Four- and eight-digit alpha codes are intentionally rejected so the RGB result is unambiguous.

Can I use the RGB result in CSS?

Yes. Paste the complete output, such as background-color: rgb(255, 87, 51);.

Related color tools