Convert Hex to RGB & RGBA

Decode 3-, 6-, and 8-digit Hex codes into 0–255 RGB integers, normalized floats, and modern space-separated CSS rgb() strings.

0 bytes sent
  • 100% browser-local
  • Zero server transfers
  • CSS Color 4 precision

or drop a color string, CSS/JSON snippet, or file here · Ctrl V to paste · Paste Hex, RGB, HSL, OKLCH or use Screen Eyedropper

Instant Before & After Specimen

CSS4 Space-Separated + RGBA
Input Samplecobalt.hex
#2563EB
Expected OutputRGB
rgb(37 99 235)

HEX vs RGB

Source vs. target format specification comparison
PropertySource: HEXTarget: RGB
Gamut scopesRGB (Standard Web)sRGB (Standard Web)
Perceptual uniformityNoNo
Alpha channel supportYesYes
Human readabilityMediumMedium
Extension / Token.css / .txt.css / .json
Best forCompact copy-paste handoff in sRGB brand guidelines and legacy CSSPixel buffers, Canvas 2D shaders, and programmatic alpha opacity blending

How to use Hex to RGB

Hex to RGB — cleanly inside your local browser with zero server transfers.

  1. Enter or pick a colorType Hex, RGB, HSL, OKLCH, or Lab — or click Screen Eyedropper and live sliders.
  2. Inspect math & gamutReview exact CSS Color 4 readouts, sRGB vs Display P3 status, and profile options.
  3. Copy, chain, or exportCopy ready CSS/JSON snippets, download binary swatch files, or pipe directly to related Colr tools.

Frequently asked questions

Does it accept 3-digit shorthand and 8-digit alpha Hex?

Yes — #09F, #2563EB, and #2563EB80 parse cleanly with automatic alpha detection.

Should modern CSS use space-separated rgb() instead of rgba()?

In CSS Color 4, rgb(37 99 235 / 50%) is valid everywhere while older comma syntax remains supported.