Free Online Hex to RGB

Hex-to-RGB conversion unpacks a hex color code like #FF5733 into three 0–255 decimal channels suitable for CSS rgb() and Canvas APIs.

Your data is processed entirely in your browser and never sent to any server.

Instant results 100% private No signup needed

Accepts #RGB, #RRGGBB or #RRGGBBAA.

59
Red
130
Green
246
Blue
CSS output
rgb(59, 130, 246)
Formula

Split the 6 hex digits into RR, GG, BB pairs. Each pair is base-16 (00–FF) → decimal (0–255). 8-digit hex adds an alpha pair AA → alpha (0–1).

How to Use This Tool

  1. Paste a hex color (with or without the leading #) into the input field.
  2. Or click the swatch on the right to open your system's color picker.
  3. Read the live Red, Green and Blue channel values, each on the 0–255 scale.
  4. Click the copy icon to send the full rgb() or rgba() string to your clipboard.

What Is a Hex to RGB?

Hex notation is a compact base-16 encoding of an RGB triple defined by CSS Color Module Level 4. Every 6-digit string breaks into three pairs (RR, GG, BB), each a base-16 number from 00 to FF — which is 0 to 255 in decimal. Three-digit shorthand expands each digit (`#F53` becomes `#FF5533`), and 8-digit forms add an alpha channel from `00` (fully transparent) to `FF` (fully opaque).

This converter is the right tool when you're handed a hex from a spec sheet or sketch file and need RGB for a Canvas drawing context, a WebGL uniform, an image-processing pipeline that takes channel arrays, or a CSS variable preferring the `rgb()` notation for opacity tweaks via `color-mix()`.

It parses 3-, 6- and 8-digit inputs, shows the per-channel breakdown so you can sanity-check the math, and emits both `rgb()` and `rgba()` strings.

Frequently Asked Questions

What hex formats are accepted?
3-digit (#F53), 6-digit (#FF5733) and 8-digit with alpha (#FF5733AA). The leading # is optional.
What is the conversion formula?
Split the 6 hex digits into RR, GG, BB pairs. Each pair is a base-16 number from 0 to FF, which converts to a decimal 0–255 for that channel.
Does it support alpha (RGBA)?
Yes. An 8-digit hex like #FF5733AA includes alpha as the last two characters. The tool outputs rgba(255, 87, 51, 0.67) in that case.

Published by the WeGotEveryTool team. We build and test every tool in-house and update pages when the underlying spec, formula, or recommendation changes.

Reviewed: May 2026. Disclaimer: this tool is provided as-is for general informational use. For decisions with material consequences (medical, legal, financial, security) verify results against a qualified professional source.

Related Color & Design