Home/Calculators/Color Tools/Hex to RGB Converter

Hex to RGB Converter

Paste a hex swatch from Figma, Sketch or a brand guide and read the RGB values you can drop straight into CSS.

hex-to-rgb-converter
Result
—
In summary: #ff5733 is rgb(255, 87, 51). A hex code stores three bytes — red, green and blue — as pairs of base-16 digits, so ff = 255, 57 = 87 and 33 = 51. Designers need the decimal form whenever a tool asks for channels rather than a hex string, such as rgba() overlays, canvas fills or design tokens.

How a hex code maps to RGB

A six digit hex code is three base-16 byte pairs. Split it into ff, 57 and 33, then convert each pair to decimal: the first hex digit counts sixteens and the second counts ones. So ff is 15×16 + 15 = 255, 57 is 5×16 + 7 = 87 and 33 is 3×16 + 3 = 51. Short three digit codes such as #f53 simply double each digit to #ff5533.

Once you are done here, the RGB to hex converter picks up where this leaves off.

Why designers need the RGB form

Hex is fine for solid fills, but the moment you need transparency you need channels: rgba(255, 87, 51, .15) gives a soft tint of the same brand colour for hover states, focus rings and card shadows. RGB is also what canvas, SVG filters, most design token pipelines and native mobile colour objects expect. Once you have the channels you can push them into the RGB to HSL converter to reason about hue and lightness instead of raw numbers.

For a closely related job, the colour picker does it in one click.

Reading the badge

The tool also reports whether the swatch is light or dark using perceived luminance, which weights green far more heavily than blue. That is a quick sanity check before you place text on the colour — for a real pass or fail, run it through the contrast checker.

Everything is converted in your browser, so the codes you paste are never uploaded or stored.

Frequently asked questions

What is #ff5733 in RGB?
It is rgb(255, 87, 51) — a saturated coral orange with the red channel at maximum.
Does it accept three digit hex codes?
Yes. Shorthand like #f53 is expanded to #ff5533 before conversion, exactly as browsers do.
Do I need the # sign?
No. The converter strips a leading hash if you paste one and works either way.
How do I add transparency?
Take the three channels and add an alpha value from 0 to 1, for example rgba(255, 87, 51, 0.2).
Does it handle 8-digit hex codes with alpha?
No — the converter reads 3 and 6 digit codes only, so an 8-digit value like #ff5733cc is not accepted. Drop the last two digits, convert the remainder, then add the alpha yourself as a 0-1 decimal in rgba().
How this tool works

The formula behind this tool is written out in full in the sections above, so you can check the maths yourself. Every calculator on Calculorium is verified against worked examples with automated tests before it is published, and pages are reviewed as formulas or standards change. Nothing you type is sent anywhere — the calculation runs entirely in your browser. Read how we build and check these tools.

Last updated: October 2, 2026 · Calculations run in your browser. Estimates for information only.