HEX to RGB Converter

Convert a HEX color code into its RGB equivalent instantly — accurate values ready to paste into CSS, canvas code, or design tools.

  • Free
  • No signup
  • Private

Overview

Convert a HEX color code into its RGB equivalent instantly — accurate values ready to paste into CSS, canvas code, or design tools.

Benefits

  • Instant, live conversion as you type
  • Accurate RGB output for CSS and JS
  • Works with or without the # symbol
  • Free, no design software needed

Use Cases

  • Converting a brand HEX palette to RGB for code
  • Building CSS rgba() transparency values
  • Setting colors in canvas or JavaScript drawing
  • Translating a designer's spec into developer-ready values

Users Also Use

How to Use

  1. Enter a HEX color code, like #2563eb.
  2. The RGB value updates live as you type.
  3. Copy the RGB result for use in CSS or design software.

What is the difference between HEX and RGB?

Both describe the same colour using red, green and blue light, each from 0 to 255. RGB writes the three values as numbers, for example rgb(37, 99, 235). HEX writes them as three pairs of hexadecimal digits after a #, for example #2563eb. Designers often copy HEX codes from design tools, while CSS, canvas code and many apps accept or need RGB, especially when you want to add transparency with rgba().

How the conversion works

Split the six digits into three pairs and convert each pair from base 16 to base 10. In hexadecimal, a to f stand for 10 to 15, and each pair is first digit × 16 + second digit.

#2563eb
25 → 2×16 + 5  = 37   (red)
63 → 6×16 + 3  = 99   (green)
eb → 14×16 + 11 = 235 (blue)
Result: rgb(37, 99, 235)

Input rules

  • Enter six hex digits, with or without the leading #. Upper and lower case both work.
  • Three-digit shorthand such as #fa0 is not accepted. Expand it by doubling each digit: #fa0 becomes #ffaa00.
  • Eight-digit codes with an alpha channel (#RRGGBBAA) are not accepted. Convert the first six digits, then add the transparency yourself, for example rgba(37, 99, 235, 0.5).

Live preview

The colour swatch updates as you type, so you can check you copied the right code. To go the other way, use RGB to HEX, or use the Color Converter to switch between both formats in one place. Everything runs in your browser.

FAQ

Do I need to include the # symbol?
You can type the HEX code with or without the leading #; the tool handles both.
Does it support 3-character shorthand HEX codes?
Standard 6-character HEX codes are the primary format supported for accurate conversion.
Where is RGB format needed instead of HEX?
RGB is often required for CSS rgba() transparency values, canvas drawing in JavaScript, and some design tool color pickers.
What is #ffffff in RGB?
rgb(255, 255, 255), which is white. #000000 is rgb(0, 0, 0), which is black.
Why is my 3-digit HEX code rejected?
The tool expects the full six-digit form. Double each digit of the shorthand, so #abc becomes #aabbcc.
How do I add transparency?
Use rgba() with a fourth value from 0 (fully transparent) to 1 (opaque), for example rgba(37, 99, 235, 0.5).

Keep exploring