Skip to main content
7BBusyBoss

HEX to RGB Converter — Free, Instant

Convert hex color codes to RGB and RGBA instantly. Control transparency, build CSS variables, and compose reusable color systems.

No limitsZero data leaksSuper fast
Files never leave your browser
  • RGB
    rgb(79, 70, 229)
  • HEX
    #4F46E5
  • HSL
    hsl(243, 75%, 59%)
  • HSV
    hsv(243, 69%, 90%)
  • CMYK
    cmyk(66%, 69%, 0%, 10%)
  • OKLCH
    oklch(0.5106 0.2301 276.97)

You're on 7BusyBoss — 300+ free tools that run instantly in your browser. No signup, nothing uploaded.

Browse all Color Converters
About this tool

When You Need Channels: Transparency and Alpha

A HEX color like #3B82F6 is opaque by definition. But the moment you need a tinted overlay, a disabled state, or a semi-transparent background, you need channels. Converting to rgb(59, 130, 246) unlocks alpha control—you can immediately compose rgba(59, 130, 246, 0.5) for 50% opacity. Hex gives you a single indivisible token; RGB gives you individual values you can manipulate independently. Modern CSS also supports 8-digit hex with alpha (#3B82F6CC), and every current browser understands it. The reason codebases still reach for rgba() is not compatibility—it is that a decimal alpha is far easier to read and adjust than a hex pair (is CC 70% or 80%?), and the channel-variable pattern below needs decimal channels anyway.

CSS Custom Properties and the Channel Pattern

The use that pays off most is storing the channels as bare numbers in a CSS variable. Instead of defining --brand-color: #3B82F6 and then struggling to build translucent versions, store the channels space-separated: --brand: 59 130 246. Then compose both solid and transparent at the point of use:

background: rgb(var(--brand)); /* solid */ and background: rgb(var(--brand) / 50%); /* translucent */

Note the spaces rather than commas—the slash-alpha form only works with the modern space-separated syntax, so a variable holding 59, 130, 246 will silently fail the moment you add / 50%. One variable, infinite variants. This is why designers' hex hand-offs get converted to RGB during implementation—it's not about the notation, it's about unlocking composition and reuse at scale. For the reverse conversion, see RGB to HEX. To explore perceptual color spaces, try HEX to HSL.

The Arithmetic: Decoding Hex Pairs

HEX notation uses base 16. Each pair of hex digits represents one RGB channel (0–255). For #3B82F6: the first pair 3B decodes as 3×16+11=59 (red channel), 82 becomes 8×16+2=130 (green), and F6 is 15×16+6=246 (blue). The conversion is exact—both notations describe the same sRGB color, nothing is gained or lost.

Three-digit shorthand is expanded before decoding, by doubling each digit: #3BF is read as #33BBFF, not as #3B0F00 or anything padded with zeros. This is why shorthand can only express 4,096 of the 16.7 million sRGB colors—each channel is restricted to the 16 values 00, 11, 22FF. A color that looks close in shorthand is rarely the exact color a designer picked.

Alpha and 8-Digit Hex Input

If you paste an 8-digit hex code like #3B82F6CC, this tool reads the RGB portion (#3B82F6) and drops the alpha digits. This is intentional: the RGB triple is the reusable part, and carrying an alpha through would make the output unusable in the channel-variable pattern above. Re-apply transparency after conversion with rgba(59, 130, 246, 0.8) or rgb(59 130 246 / 80%), which gives you full control over the alpha at the moment you need it.

How to use the HEX to RGB Converter

Takes about a minute. No signup, no download, your data stays in your browser.

  1. 1
    Open the tool. Scroll up to the HEX to RGB Converter above — it loads instantly in your browser, no install needed.
  2. 2
    Enter your values. The fields come pre-filled with realistic defaults so you can see how it works — replace them with your own numbers.
  3. 3
    Read the result. The output updates instantly. Copy or share it — nothing is uploaded to a server, everything stays on your device.

Frequently asked questions

Common questions about the HEX to RGB Converter.

How do I add transparency to a hex color?

Hex colors are opaque by default. Convert to rgba() to add transparency: #3B82F6 becomes rgba(59, 130, 246, 0.5) for 50% opacity. Modern browsers also support 8-digit hex like #3B82F6CC, but a decimal alpha is easier to read and tweak than a hex pair, which is why rgba() and the rgb(r g b / a) form remain the common choice.

What is rgba and when do I use it?

RGBA stands for Red, Green, Blue, Alpha. It's identical to rgb() but with a fourth value (0–1 or 0–100%) controlling transparency. Use rgba() for overlays, shadows, disabled states, or any UI element needing partial opacity. CSS also supports the slash notation: rgb(59 130 246 / 50%) does the same thing.

How do I convert hex to rgb by hand?

Split the hex code into three pairs. Each pair is base 16. For #3B82F6: 3B = 3×16+11 = 59 (red); 82 = 8×16+2 = 130 (green); F6 = 15×16+6 = 246 (blue). Result: rgb(59, 130, 246). Digits 0–9 are face value; A–F are 10–15. Common shortcuts: FF=255, 80=128, 00=0.

What does a 3-digit hex code like #3BF mean?

It is shorthand that expands by doubling each digit, so #3BF means #33BBFF. It does not pad with zeros. Because each channel is limited to 00, 11, 22 and so on up to FF, shorthand can only express 4,096 of the 16.7 million sRGB colors — it is convenient for quick prototyping but rarely matches an exact brand color. This tool expands shorthand automatically before converting.

Why use CSS variables with RGB channels?

Storing channels as space-separated numbers (--brand: 59 130 246) lets you reuse the variable at different opacities: rgb(var(--brand)) for solid and rgb(var(--brand) / 50%) for translucent. Use spaces, not commas — the slash-alpha syntax fails with a comma-separated variable. One variable serves every variant; hex cannot do this, since you would need a separate variable per opacity level.

Community rating

Discussion (0)

No comments yet. Start the discussion.