FREE TOOL · MATH

Hex to RGB Converter

Paste any hex color — #2563eb, #f53, even 8-digit #2563ebcc with alpha — and get the RGB triplet, ready-to-paste CSS, a luminance verdict for text color, and the actual color on a swatch. Works in reverse too.

164

Convert hex to RGB (and back)

On the default, #2563eb → rgb(37, 99, 235) — a medium blue with relative luminance 0.16, so white text wins. Paste your own color below.

Which way to convert. The calculator reads the matching fields below.

3, 4, 6, or 8 hex digits, with or without the #. #f53 is shorthand for #ff5533; an 8th pair sets transparency.

Only read when converting RGB → Hex. Whole numbers 0 to 255.

Only read when converting RGB → Hex.

Only read when converting RGB → Hex.

Leave blank for fully opaque (alpha 1). 0.5 is half transparent. Only read when converting RGB → Hex.

Result—Enter values above

Enter values to see the result.

How a hex color works: six digits, three channels

A hex color is three two-digit hexadecimal numbers glued together: #RRGGBB. Each pair runs from 00 (none) to FF (full) — that is 0 to 255 in decimal, or 256 levels per channel. So #2563eb means red 2516 = 37, green 6316 = 99, blue eb16 = 235. Three channels × 256 levels = 16,777,216 possible colors — every color your screen can show lives in this scheme. The 3-digit shorthand just doubles each digit: #f53 = #ff5533. And an optional fourth pair sets alpha (transparency): #2563eb80 is the same blue at 50% opacity.

Output · formula · meaning

OutputFormulaWhat it means
RGB tripleteach hex pair → decimal#2563eb → rgb(37, 99, 235).
CSS snippetrgb() or rgba() with alphacopy-paste ready for stylesheets.
Relative luminance0.2126R + 0.7152G + 0.0722B (linearized)0.16 for the default — a dark color.
Text-color verdictcontrast ≥ 4.5:1 vs white or blackwhite text wins on the default blue.

FF means full, 00 means none

The fastest mental read: #ffffff is all three channels maxed → white; #000000 is all off → black. Equal pairs make grays: #808080 is mid-gray (128 each). One channel maxed alone gives the primaries: #ff0000 red, #00ff00 green, #0000ff blue. Everything else is a mix — and the converter decodes any mix instantly.

When to use HEX vs rgb()

They describe the same colors — the choice is workflow. HEX is shorter and dominates design files, brand guides, and copy-paste from pickers. rgb() is friendlier when you compute colors in code (animations, canvas, theming with CSS variables) and mandatory when you need alpha in old browsers: rgba(37, 99, 235, 0.5) is clearer than #2563eb80 to a human reader. Modern CSS also accepts the 8-digit hex — both are fine, so use whichever your team reads faster.

Who uses this

  • Web developers: translating designer hex specs into CSS and debugging color math.
  • Designers: checking what a brand color actually is before recoloring assets.
  • Data-visualization folks: pulling channel values apart to build accessible palettes.
  • Email & slide builders: matching brand colors across tools that only accept RGB.

Accuracy & limitations

Conversions are exact integer arithmetic between base-16 and base-10 — 256 levels per channel, no rounding. Luminance uses the WCAG relative-luminance formula with sRGB linearization; the text verdict checks the 4.5:1 WCAG AA threshold. Displayed colors assume sRGB, which matches virtually all consumer screens; wide-gamut (Display P3) screens may render slightly more vividly.

More base conversions: the binary, hex & decimal chart covers 0–255 in every base, and the significant figures calculator handles precision in the decimal world.

Cite this calculatorBright Side Kit. “Hex to RGB Converter with Live Preview.” brightoolbox.com, 2026.Bright Side Kit. "Hex to RGB Converter with Live Preview." https://brightoolbox.com/hex-to-rgb-converter/ Accessed October 22, 2026.
Embed this calculator

Paste this into any web page to embed the live calculator. The “Bright Side Kit” link below it must stay intact.

Frequently asked questions

What is #2563eb in RGB?

rgb(37, 99, 235) — red 37, green 99, blue 235. Paste it into the converter above for the CSS snippet and a luminance verdict.

What does FF mean in a hex color?

Full intensity. Each channel runs 00 (off) to FF (full, = 255). So #ff0000 is pure red, #00ff00 pure green, #ffffff white, #000000 black.

How do I convert #fff to RGB?

Expand the shorthand: #fff → #ffffff → rgb(255, 255, 255) — white. Each doubled digit: f→ff = 255.

What is the 8-digit hex color?

It adds an alpha (transparency) pair: #RRGGBBAA. #2563eb80 is the blue at 50% opacity (8016 = 128 ≈ half of 255). Omit it and alpha is 1 — fully opaque.

HEX or RGB — which should I use in CSS?

They are identical colors. HEX is shorter (great for brand specs); rgb()/rgba() is clearer when alpha or computed values are involved. Use whichever your team reads faster.

How do I know whether to use white or black text?

Check contrast. The converter computes relative luminance and tests both against the WCAG AA 4.5:1 bar — on the default blue, white wins. Luminance below ~0.18 usually means white text; above ~0.35, black.

Why does my color look different in print?

Screens emit light (additive RGB); printers lay down ink (subtractive CMYK). Neon and deep blues shift the most. Convert with your printer's profile or pick from a printed swatch book for exact matches.