Skip to main content

HEX to RGB Converter – Convert HEX Online (Free Tool)

Free online HEX to RGB Converter tool to convert HEX color codes to RGB values. Get red, green, and blue color components instantly. Perfect for web developers and designers.

Example Output

Useful when you need each channel separately, e.g. for a canvas drawText fill or a JS colour interpolation.

#3B82F6
rgb(59, 130, 246) — Red 59, Green 130, Blue 246

What is HEX to RGB Converter?

HEX to RGB converts a 3- or 6-digit hex colour into rgb() and hsl() values. Built for the everyday case where a designer hands you a HEX, you paste it once and copy the format your stack actually expects — JS canvas APIs and many older CSS examples use rgb(), while design tokens often prefer HSL.

Why use this tool?

  • Open-and-go: bookmark the page once and never look for an alternative
  • Instant results — no waiting on a server or upload progress bar
  • Touch-friendly UI, fine on phones for on-the-go edits
  • Works with any color input format — HEX, RGB, RGBA, HSL, HSLA, named colors
  • WCAG contrast checks calculated correctly for AA and AAA, both text and large text

How to use

  1. Type or paste a HEX code (3-digit shorthand like #fff works too)
  2. Click Convert to see RGB and HSL output alongside individual R, G, B values
  3. Click any value to copy it to the clipboard
  4. Tweak the colour with the native picker to compare adjacent shades

Examples

Shorthand HEX works

Input #fff returns rgb(255, 255, 255). #f00 returns rgb(255, 0, 0). No need to expand them manually first.

Drop into a CSS variable

Paste #1F2937, copy the rgb(...) result, and use it inside a CSS variable so you can later add alpha via rgba(var(--c), 0.6).

Common use cases

  • Converting brand colours from a HEX-only style guide into rgb()/hsl() variants
  • Feeding RGB channels into JS Canvas, WebGL or D3 colour scales
  • Building a colour-token system that needs both notations

Troubleshooting

"Invalid HEX color format".
The tool accepts 3 or 6 hex digits with optional leading #. Alpha hex (8 digits) is not supported — use RGBA to HEX or the Color Converter for those.

Frequently Asked Questions

A HEX code has 6 characters (e.g., #FF5733). Split it into three pairs: FF, 57, 33. Convert each pair from hexadecimal to decimal: FF=255, 57=87, 33=51. So #FF5733 becomes rgb(255, 87, 51).

Try these related tools

Explore more Color Tools

Discover other free, privacy-first tools in Color Tools.