HEX to RGB color converter — free online tool

Convert a 3- or 6-digit HEX color to rgb(r, g, b) in your browser, with a live swatch. Example: #6D28D9 becomes rgb(109, 40, 217).

Convert a HEX value locally. No image upload is needed.

What to know

HEX is RGB written in base 16. The six digits after the hash are three pairs, one each for red, green and blue, and every pair runs from 00 (0) to FF (255). This converter reads those pairs and shows rgb(r, g, b) next to the normalized #RRGGBB form, with a swatch so you can see the color at once.

The field opens with #6D28D9. Split it into 6D, 28 and D9: 6D is 6 x 16 + 13 = 109, 28 is 2 x 16 + 8 = 40 and D9 is 13 x 16 + 9 = 217, so the answer is rgb(109, 40, 217). The leading # is optional, and upper or lower case both work.

Three-digit shorthand is accepted too. Each digit is doubled, so #F80 becomes #FF8800 and then rgb(255, 136, 0). Values with any other length, including eight-digit HEX with an alpha pair, are rejected with a red message instead of being guessed.

Nothing is uploaded, because the conversion is a few lines of arithmetic running in the page. The color input beside the field lets you pick a shade visually and read back its HEX and RGB, and each value has its own copy button for pasting into CSS, a design tool or a slide.

Choose a specific task 12
Related tools 13
How to use HEX to RGB color converter — free online tool
  1. Type or paste a HEX value into the HEX field, for example #6D28D9 (the # is optional).
  2. Or click the color preview input and pick a shade; the field updates to its #RRGGBB code.
  3. Check the swatch, then read the result: #6D28D9 gives rgb(109, 40, 217).
  4. Click the RGB button to copy rgb(109, 40, 217), or the HEX button to copy the uppercase #6D28D9.

Quick answers

How does #F80 turn into RGB?

Each digit is doubled first, so F80 becomes FF8800. That is red 255, green 136 and blue 0, shown as rgb(255, 136, 0).

Does it accept 8-digit HEX with transparency?

No, only 3 or 6 hex digits are accepted, so #6D28D980 shows an error. Convert the alpha pair yourself (80 in hex is 128, about 50 percent) and write rgba() in your CSS.

Why is the output always uppercase?

Every valid input is normalized to uppercase #RRGGBB, so #6d28d9 and 6D28D9 both read back as #6D28D9. CSS treats both spellings the same.