WebToolsPlanet
Converter Tools

HEX to RGB

Enter a HEX colour code and instantly get the R, G, B channel values and the CSS rgb() function string. Useful for translating design tokens, reading colour values from design files, and writing CSS.

Last updated: May 28, 2026

Client-Side Processing
Input Data Stays on Device
Instant Local Execution

Find this tool useful? Support the project to keep it free!

Buy me a coffee

What is HEX to RGB?

HEX and RGB are two ways to express the same colour. A HEX code like #3B82F6 encodes the red, green, and blue channels as two hexadecimal digits each. RGB expresses those same channels as decimal integers from 0 to 255.

CSS accepts both formats, but some contexts — canvas drawing, image processing, colour arithmetic — require raw integer values. This tool handles both 3-digit shorthand (#RGB) and 6-digit (#RRGGBB) HEX codes.

How to Use HEX to RGB

1

Type or paste a HEX code (with or without the # prefix)

2

The RGB values and css rgb() string appear instantly

3

Copy the output with the copy button

Common Use Cases

  • Frontend developers converting design token hex values to RGB for CSS custom properties or canvas APIs.
  • Designers checking the RGB breakdown of a brand colour.
  • Developers reading hex values from Figma or Sketch and needing RGB for a JavaScript colour library.
  • CSS authors who prefer rgb() over hex for readability or when alpha is needed.

Example Input and Output

Converting the Tailwind blue-500 brand colour from HEX to RGB.

HEX input
#3B82F6
RGB output
rgb(59, 130, 246)

For alpha transparency

If you need rgba() output with an opacity value, use the HEX to RGBA tool.

Browser-side only

Conversion runs locally in your browser.

Frequently Asked Questions

Does this support 3-digit HEX codes?
Yes. #RGB shorthand (e.g. #F80) is expanded to #FF8800 before conversion.
Do I need the # prefix?
No — you can enter the hex digits with or without a leading #.
How do I add an alpha channel?
Use the HEX to RGBA tool to specify an opacity value and get rgba() output.
Is my data sent to a server?
No. All conversion runs in your browser.