FREE WEB TOOL

HEX to RGB converter

Convert #RGB or #RRGGBB hexadecimal colors into RGB values.

Use tool

🔒 Inputs are processed locally in your browser.

How to use it

Convert three- or six-digit HEX color codes into RGB channel values from 0 to 255. The leading # is optional and hexadecimal letter case does not matter.

  1. Enter a value such as #315EE8.
  2. Select Convert.
  3. Review rgb(...) plus the separate R, G and B values.
Accepted
3-digit / 6-digit HEX
#
Optional
3-digit expansion
#ABC → #AABBCC
Whitespace
Not allowed inside the code

#ABC expands to #AABBCC

#ABC duplicates each digit, becoming #AABBCC and then rgb(170, 187, 204).

Four- and eight-digit alpha forms (#RGBA / #RRGGBBAA) are not supported. This converter intentionally returns RGB channels only.

Each HEX byte becomes one RGB channel

00 through FF maps to decimal 0 through 255. The first byte is red, the second green and the third blue.

Three-digit HEX is shorthand

Each digit is duplicated before conversion, so #ABC is treated exactly like #AABBCC.

Letter case does not matter

A–F and a–f represent the same hexadecimal digits and produce identical RGB values.

Internal spaces are invalid

Leading and trailing whitespace is trimmed, but #315E E8 is rejected because the space occurs inside the color code.

Useful for CSS value translation

The output provides standard rgb(...) syntax as well as individual channel numbers, making it easy to move a color between CSS, design tools and image editors.

Alpha is outside scope

The tool does not parse transparency from four- or eight-digit HEX input. Use a converter that explicitly supports RGBA when opacity matters.

Validation is intentionally narrow

After the optional # is removed, the remaining input must be exactly three or six hexadecimal digits, which prevents partial or ambiguous conversion.

Related references: Image formats