#635BFF) used by CSS and design tools and the alpha-aware RGBA notation (rgba(99, 91, 255, 0.5)) used for transparent overlays. Our free converter outputs HEX, RGB, RGBA, HSL, HSV, CMYK, and OKLCH all at once, with a live alpha slider and one-click copy on each format.Frontend developers translate between colour formats dozens of times a week. The brand book has HEX. The CSS needs RGBA when transparency is involved. The design tool wants HSL or HSV for the colour picker. The print spec needs CMYK. A multi-format colour converter is the kind of utility that sounds trivial until you’ve spent five minutes copy-pasting into a different tool for each format you need.
Our HEX to RGBA converter takes any HEX value (3-digit shorthand, 6-digit, or 8-digit with alpha) and instantly outputs every common colour format simultaneously. Drag the alpha slider to add transparency without retyping. This guide explains the seven colour formats every web designer encounters, when each is the right choice, and the gotchas that produce subtly-wrong colour conversions.
The seven colour formats and when each is right
| Format | Example | Best use |
|---|---|---|
| HEX (6-digit) | #635BFF |
CSS, brand books, design tools — universal web notation |
| HEX (8-digit, with alpha) | #635BFF80 |
CSS shorthand for RGBA; 80 = ~50% alpha. Less readable than rgba() |
| RGB | rgb(99, 91, 255) |
Programming (every image library uses RGB), some legacy CSS |
| RGBA | rgba(99, 91, 255, 0.5) |
CSS with explicit transparency — overlays, glassmorphism, backdrops |
| HSL | hsl(244, 100%, 68%) |
Building tints/shades by adjusting one value (lightness) |
| HSV / HSB | hsv(244, 64%, 100%) |
Photoshop/Affinity colour picker default — useful for design-tool match |
| OKLCH | oklch(63% 0.27 286) |
Modern CSS (Chrome 111+, Safari 15.4+, Firefox 113+); perceptually uniform |
| CMYK | cmyk(61%, 64%, 0%, 0%) |
Print only — magazine, brochure, business card |
Why HEX has 6 digits — and the 3-digit shorthand
A 6-digit HEX encodes red, green, and blue channels at 8-bit precision (0-255 each), written as two hexadecimal digits. #635BFF means red=63 (hex) = 99 (decimal), green=5B = 91, blue=FF = 255.
The 3-digit shorthand #FFF is equivalent to #FFFFFF — each digit is duplicated. Useful for pure colours but loses precision: only 4096 distinct colours fit in 3-digit shorthand vs 16.7 million in full 6-digit form. CSS accepts both, but designers prefer 6-digit for non-trivial colours.
The 8-digit form (#635BFF80) adds an alpha channel: the last two hex digits represent transparency from 00 (fully transparent) to FF (fully opaque). 80 in hex is 128 in decimal, or 50% alpha. Most browsers (~98% support since 2018) understand 8-digit HEX, but it’s harder to read than the explicit rgba() form for the same value.
How to use the browser HEX to RGBA converter
- Open the HEX to RGBA converter
- Type or paste a HEX value into the input — 3-digit, 6-digit, or 8-digit forms all accepted
- Every output format updates instantly: HEX, RGB, RGBA, HSL, HSV, OKLCH, CMYK
- Drag the alpha slider (0-100%) to add transparency. The RGBA, 8-digit HEX, HSLA, and HSVA outputs update with the new alpha
- Click any format’s copy icon to grab that exact value to your clipboard
- Use the inverse (RGBA → HEX) by entering values into the RGB or RGBA fields directly
Every format also includes a small contrast-ratio readout against pure black and pure white, so you can quickly evaluate whether a colour will pass WCAG AA contrast for body text.
Converting in code
Plain JavaScript:
function hexToRgba(hex, alpha = 1) {
const m = hex.replace("#", "").match(/^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);
if (!m) return null;
const [, r, g, b] = m.map((s, i) => i === 0 ? s : parseInt(s, 16));
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
}
hexToRgba("#635BFF", 0.5);
// => "rgba(99, 91, 255, 0.5)"
Modern CSS (no JavaScript needed):
/* 8-digit HEX with alpha — supported since 2018 */
.overlay { background: #635BFF80; }
/* color-mix to add transparency to an existing variable */
.overlay { background: color-mix(in srgb, var(--brand) 50%, transparent); }
/* RGB notation with optional / alpha — modern CSS Color 4 syntax */
.overlay { background: rgb(99 91 255 / 0.5); }
JavaScript with colord:
import { colord } from "colord";
const c = colord("#635BFF");
c.toRgb(); // { r: 99, g: 91, b: 255, a: 1 }
c.toHsl(); // { h: 244, s: 100, l: 68, a: 1 }
c.alpha(0.5).toRgbString(); // "rgba(99, 91, 255, 0.5)"
Common gotchas in HEX conversion
- Mixing up HSL and HSV. HSL’s lightness goes from 0% (black) to 100% (white) with the colour at 50%. HSV’s value goes from 0% (black) to 100% (full colour at maximum). They look similar but produce subtly different results when adjusted. Make sure your design tool uses the same one your CSS does.
- Trusting CMYK conversion from a screen colour. RGB and CMYK have different gamuts. Vivid screen colours often can’t be reproduced in print. The CMYK output from any web tool is an approximation; use a print-aware tool with ICC profile management for production work.
- Forgetting alpha in 8-digit HEX.
#635BFFand#635BFFFFare identical (FF = 100% alpha).#635BFF80has 50% alpha. Trim the alpha when you don’t need it for cleaner CSS. - Using HSL hue values incorrectly in code. CSS expects
hsl(244, 100%, 68%)with hue in degrees. Some libraries store hue normalized to 0-1. Mixing the two produces colours that look right at a glance but are subtly off.
When to choose RGBA vs 8-digit HEX vs color-mix
- RGBA for explicit transparency in CSS where the value itself is meaningful (e.g., a 25% black overlay):
rgba(0, 0, 0, 0.25)reads more clearly than#00000040. - 8-digit HEX for compact CSS when you have a known opaque colour and need a transparent variant:
#635BFF80is shorter thanrgba(99, 91, 255, 0.5). - color-mix(in srgb, var(–brand) 50%, transparent) for derived transparency from a CSS variable. Lets your brand colour change once and all transparent variants update.
- RGB with slash notation (CSS Color 4):
rgb(99 91 255 / 0.5)— the modern standard, supported in 95%+ of browsers as of 2026.
Frequently asked questions
Why does my HEX colour look different in different applications?
Three common causes: (1) your monitor’s colour profile differs from the source — calibrate displays for consistent results across devices; (2) the source uses Display P3 colour space (modern Macs, iPhones) and the target only renders sRGB; (3) image gamma or colour management differences between Photoshop, browsers, and print drivers. The HEX value is the same; the rendering varies.
Should I use 6-digit or 8-digit HEX?
6-digit for opaque colours — universal, readable, supported everywhere. 8-digit when transparency is essential — cleaner than rgba() in some cases. Avoid 8-digit if you’ll still need to support browsers older than 2018 (effectively zero modern audience, but rare legacy contexts exist).
Does the converter handle CSS variables?
The tool converts the resolved colour value, not CSS variable references themselves. To convert var(--brand) via the tool, look up the actual HEX value in your stylesheet first. For runtime variable conversion in JavaScript, use getComputedStyle(element).getPropertyValue('--brand') to read the resolved value.
What’s the difference between HSL and OKLCH?
HSL uses a cylindrical model with hue rotation, but its lightness isn’t perceptually uniform — equal numerical changes produce visually unequal changes (especially around yellow and cyan). OKLCH uses a perceptually uniform colour space, so equal lightness changes look equal regardless of hue. OKLCH is the modern best practice for design systems; HSL is fine for simple tints and shades within a single hue.
Can the tool convert HEX to print-ready CMYK?
The CMYK output is an approximation derived from sRGB → CMYK conversion. For production print, ask your printer for their colour-managed conversion using your specific ICC profile. The tool gets you within ~10% of the printer’s value, which is fine for proofs and mockups but not for final print specs.
Is my colour data sent anywhere?
No. The converter runs entirely in your browser using JavaScript. The HEX you type, the alpha you adjust, and the converted outputs all stay on your device. Verify in DevTools’ Network tab — there are no requests when you type or convert.
Related tools and guides
- HEX to RGBA Converter — the tool this guide is about
- RGBA to HEX Converter — the inverse direction
- Color Shades Generator — turn any HEX into an 11-step ramp
- Color Mixer — interpolate between two colours
- Image Color Picker — sample a HEX from any photo
- All color tools
![HEX to RGBA Converter: All Color Formats at Once [2026]](https://simpletool.io/blog/wp-content/uploads/2026/05/hex-to-rgba-converter.png)
![Color Mixer Tool: Blend Two Colours in OKLCH [2026]](https://simpletool.io/blog/wp-content/uploads/2026/05/color-mixer-tool.png)
![Color Shades Generator: Build a Tailwind 50-950 Ramp [2026]](https://simpletool.io/blog/wp-content/uploads/2026/05/color-shades-generator.png)
![Image Color Picker Tool: Sample HEX, RGB & HSL [2026]](https://simpletool.io/blog/wp-content/uploads/2026/05/image-color-picker-tool.png)