Color Picker
Use Color Picker to choose and convert color precisely — instant and free.
Pack red, green and blue numbers into the compact #RRGGBB hex code the web runs on.
Your browser is preparing the tool. It runs 100% locally.
Enter three numbers — red, green and blue, each 0–255 — and this returns the hex color code, like 139, 92, 246 → #8B5CF6. Each channel becomes a two-digit, zero-padded base-16 pair, joined behind a #. Decimal or out-of-range values are rounded and clamped to 0–255 first, so you always get a valid six-digit hex.
Type red, green and blue values and the tool returns the matching hex code in uppercase, with a live swatch. It reads the numbers out of whatever you paste, so '139, 92, 246', '139 92 246' and even a full rgb(139 92 246) all work. It opens on 139, 92, 246 so there's a result on screen straight away.
Hex is the web's compact color token: one short string you can drop into CSS or HTML, copy into a design tool, or paste into a chat. Photoshop, Figma, OS color pickers and screenshot eyedroppers tend to hand you RGB numbers — this packs them into the hex that stylesheets actually use.
The tool pulls the numeric groups out of your input, so the separators you use don't matter. It then clamps each channel to the 0–255 range, rounds it to a whole number, and writes it as a two-digit hexadecimal pair — padding a single digit with a leading zero — before joining the three pairs behind a #.
The output is uppercase by convention, though #8B5CF6 and #8b5cf6 are the same color. It updates as you type, and the result is reversible: run it through HEX to RGB and you get your numbers back (as long as they were whole values inside 0–255 to begin with).
No data is fetched. Hex is simply RGB re-encoded in base 16, so the conversion is pure arithmetic: each 0–255 channel maps to exactly one two-digit pair from 00 to FF, as defined for sRGB and CSS hex colors.
R, G, B → #[hex2(R)][hex2(G)][hex2(B)]
(each channel 0–255 becomes a 2-digit pair 00–FF)139, 92, 246 → 8B, 5C, F6 → #8B5CF6255, 102, 0 → FF, 66, 00 → #FF6600Single-digit hex results are zero-padded — 0 becomes 00, 9 becomes 09 — so every code is exactly six digits. Values above 255 or below 0 are clamped before encoding.
| Input | R, G, B (0–255 each); separators flexible |
|---|---|
| Output | #RRGGBB, uppercase |
| Clamping | Values outside 0–255 are clamped |
| Rounding | Decimals rounded to the nearest integer |
| Padding | Single-digit channels zero-padded |
| Alpha | Not added — six-digit hex only |
| Reversible | Yes, with HEX to RGB (whole-number input) |
| Where it runs | In your browser, live |
For whole numbers in 0–255 the conversion is exact and reversible: send the hex through HEX to RGB and the original channels come back.
Decimals are rounded and out-of-range numbers clamped, so rgb(300, -5, 128.7) becomes #FF0081. That guarantees a valid code, but it also means a messy input won't round-trip perfectly — the rounding and clamping are deliberate.
It reads numbers only. Percentage notation like rgb(50%, …) isn't supported; convert a percentage to its 0–255 value first (50% is about 128).
The result is a six-digit hex with no alpha. For transparency, append a fourth pair by hand to make an eight-digit #RRGGBBAA color.
Turn the RGB numbers a design app reports into the hex code your CSS or HTML needs.
Convert an RGB value sampled from an image or the screen into a single shareable hex token.
Take RGB produced by a script or spreadsheet and standardise it as web-ready hex.
Shorten a verbose rgb() declaration into the compact hex form for cleaner stylesheets.
Already have a hex and want the numbers? Use HEX to RGB. Need to fine-tune the color? Convert to HSL. For transparency, append an alpha pair to make an eight-digit hex yourself.
Out-of-range or decimal channels are clamped to 0–255 and rounded before encoding, so the output is always a valid six-digit hex — and exact for whole-number RGB.
Use Color Picker to choose and convert color precisely — instant and free.
Use HEX to RGB Converter 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.
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.