HEX to RGB Converter
Turn a hex color into its red, green and blue numbers and the CSS rgb() string, exactly.
Pick a colour with the swatch or type a hex code, and read it back as HEX, RGB, HSL and CMYK side by side. Your browser does every conversion.
Updated
Your browser is preparing the tool. It runs 100% locally.
Pick a color with the swatch or type a hex code, and the tool shows it in five formats at once: HEX, RGB, the CSS rgb() string, HSL and CMYK. The swatch is your browser's native color control, the same one your operating system shows, and your device works out every other value. Click any code to copy it.
Drag the swatch or type a hex code and the two stay in sync. From that one color the tool shows HEX, the three RGB channels, a ready-to-paste CSS rgb() string, HSL and a CMYK approximation. It opens on a blue (#2563EB) so there is always something to read, and a click on any code copies it.
Having every format on screen at once saves trips between converters. CSS usually wants hex or HSL, a canvas or image library wants the raw 0 to 255 numbers, and a print hand-off asks for CMYK. You pick once and take whichever notation the next tool expects.
The swatch is the browser's native color input, the same OS color dialog other applications use. The specification says it always returns a six-digit lowercase hex with no transparency channel, so that hex drives everything else on the page.
The tool splits the hex into red, green and blue, converts those to HSL, and runs the plain RGB-to-CMYK approximation, all on your device. If you type into the hex box instead, it accepts three or six digits, adds the # for you and repaints the swatch. Nothing is uploaded, and the maths runs as you click or type.
The tool uses no color database and makes no network request. It reads one sRGB color from your browser's native color control (or the hex you type) and works out the other formats in the page, using the conversions in the CSS Color and sRGB specifications.
| Input | Native color swatch + hex field (3 or 6 digit) |
|---|---|
| Output formats | HEX, RGB, rgb(), HSL, CMYK |
| Color space | sRGB, 8-bit, 0 to 255 per channel |
| Total colors | 16,777,216 (256 × 256 × 256) |
| Alpha / opacity | Not supported; the native control has none |
| CMYK | Approximate; screen reference, not print-ready |
| Copy | Click any code to copy it |
| Where it runs | In your browser, with no server call |
The CMYK figure is a plain mathematical approximation and not ready for print. RGB (light) and CMYK (ink) cover different ranges of color, and the printed result depends on the press, the ink and the paper. That is why print shops convert through an ICC profile for a specific stock. Use the CMYK here as a ballpark, and do not send it to a printer as a spec.
There is no transparency. The native color control can't express alpha, so you always get a fully opaque color. For an rgba() or hsla() value, add the alpha yourself.
HSL is rounded to whole degrees and percentages, so a hex to HSL to hex round trip can land a step or two off the original. For an exact, reversible pair, use the HEX and RGB converters.
Everything is read as sRGB. A wide-gamut color (Display P3 and similar) is treated as ordinary sRGB numbers here and is not remapped.
Grab a hex for CSS, an HSL to fine-tune and an rgb() for a gradient stop from the same pick.
Read a color's rough CMYK before sending artwork out, then confirm the exact values with your printer's ICC profile.
Pull the 0 to 255 RGB numbers a canvas, game engine or image library expects, instead of converting a hex by hand.
Paste a hex you found somewhere, see it filled large in the swatch, and copy the other format you need.
For a coordinated set of colors, use the color palette generator. To check legibility, use the contrast checker. For transparency, add an alpha value to the rgb() or hsl() output yourself, and for print, convert through your print provider's ICC profile.
All five codes come from one sRGB color, worked out in the page. The CMYK is a screen approximation with no print profile behind it, so check print values against your printer's ICC profile.
Turn a hex color into its red, green and blue numbers and the CSS rgb() string, exactly.
Check whether your text and background colours have enough contrast to read, with a pass or fail at each WCAG accessibility level.
Pack red, green and blue numbers into the compact #RRGGBB hex code the web runs on.
Compress an image to JPEG with a quality slider and watch the file size drop as you drag, in your browser.
Combine several PDFs into one file in the order you choose, without leaving your browser.
Count words, characters, sentences and paragraphs as you type, with reading and speaking time alongside.
Paste or pick your input at the top of the page. The conversion runs on this device and needs no account.