Color Picker
Use Color Picker to choose and convert color precisely — instant and free.
Turn a hex color into its red, green and blue numbers — and the CSS rgb() string — exactly and instantly.
Your browser is preparing the tool. It runs 100% locally.
Paste a hex color such as #8B5CF6 and this returns its red, green and blue values — 139, 92, 246 — plus the ready-to-use CSS string rgb(139, 92, 246). Each hex pair is just one 0–255 channel written in base 16, so the conversion is exact and instant, and three-digit shorthand like #F90 is expanded automatically before converting.
Type a hex color and the tool shows its three RGB channels as decimal numbers from 0 to 255, plus the CSS rgb() string you can paste straight into a stylesheet. It accepts the full six-digit form and the three-digit shorthand, with or without the #, and it repaints a swatch and recalculates on every keystroke. It opens on #8B5CF6 as a worked example.
Decimal RGB is what you reach for when a hex token won't do: a canvas or WebGL call, an image library in Python or JavaScript, a spreadsheet that builds colors from numbers, a game engine, or an rgba() value where you want the channels separate from the opacity.
A hex color is nothing more than RGB written in base 16. The six digits are three pairs — one for red, one for green, one for blue — so the tool strips the #, expands any three-digit shorthand to six, then reads each pair as a number from 0 (written 00) to 255 (written FF).
Because that mapping is exact, there's no color science and no rounding involved: #8B5CF6 always comes back as precisely 139, 92, 246. The whole thing recomputes locally on every keystroke, and feeding the result into the RGB-to-HEX tool returns the original hex untouched.
There's no color data to fetch. The conversion is defined entirely by how hex notation encodes an sRGB color — each two-digit pair is one 8-bit channel in base 16 — so the work is pure arithmetic done in the page.
#RRGGBB → R = base16(RR), G = base16(GG), B = base16(BB)
(each pair runs 00–FF, i.e. 0–255 in decimal)#8B5CF6 → 8B = 139, 5C = 92, F6 = 246 → rgb(139, 92, 246)#F90 → expands to #FF9900 → rgb(255, 153, 0)FF is the largest two-digit hex value, 255 in decimal; 00 is the smallest, 0. Each channel spans the full 0–255 range, which is why the conversion is exact and reversible.
| Input | Hex #RRGGBB or #RGB shorthand |
|---|---|
| Output | R, G, B (0–255) plus CSS rgb() |
| Conversion | Exact, base-16 to decimal |
| Channels | 8-bit, 0–255 each |
| Shorthand | Three-digit hex expanded automatically |
| Hash | Optional — # added if you omit it |
| Alpha | Eight-digit #RRGGBBAA not parsed |
| Where it runs | In your browser, live |
The conversion is exact and fully reversible, because hex and RGB are two notations for the same 8-bit sRGB value — there's no rounding to introduce drift. Run the output back through RGB to HEX and you get the original hex.
It expects a three- or six-digit hex. An eight-digit hex carrying alpha (#RRGGBBAA) or a named color won't parse and shows an 'invalid input' notice — strip the alpha pair first, or read it separately as opacity.
Values are interpreted as sRGB. A hex copied out of a wide-gamut (Display P3) workflow is converted as plain sRGB numbers here, not remapped to that gamut.
Get the raw 0–255 channels these APIs expect, instead of passing a hex string they can't read directly.
Take the three RGB numbers and add your own alpha to make a semi-transparent rgba() color.
Feed integer RGB into Python, JavaScript or other image-processing code that works in numbers, not hex.
Drive conditional formatting or chart colors that are defined by numeric channels rather than a hex token.
Need the reverse? Use RGB to HEX. Want to adjust a color by hue or lightness? Convert it to HSL. Working with an alpha hex? Drop the last pair here and treat it as opacity separately.
A hex color is RGB written in base 16, so this conversion is exact and reversible — feed the result back through RGB to HEX and you land on the original code.
Use Color Picker to choose and convert color precisely — instant and free.
Use Color Palette Generator to choose and convert color precisely — instant and free.
Use Gradient Generator to choose and convert color precisely — instant and free.
Use Contrast Checker to choose and convert color precisely — instant and free.
RGB to HEX Converter with copy-ready values for design and front-end work.
HEX to HSL Converter online — accurate color values, palettes and previews in-browser.
It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.