A HEX color code is a six-digit label of the form #RRGGBB that packs three RGB channels (each 0–255) into two hexadecimal digits per pair, letting you represent any of the 16,777,216 colors in the standard 24-bit color space that CSS, HTML, and tools like Figma and Photoshop all share. To convert RGB to HEX on Windows, the fastest route is a browser-based converter: open it in Edge, Chrome, Firefox, or any modern browser, type the red, green, and blue values, and the matching #RRGGBB code appears next to a live preview — no software installation, no admin rights, no restart. Because everything runs locally in JavaScript, nothing leaves your machine, which makes it practical for unreleased palettes and brand work. The same page also reads a HEX code back into RGB and HSL, so the conversion is genuinely two-way: paste #3b82f6 and you immediately see RGB (59, 130, 246) with the live swatch updating as you type. If you already have a HEX value from PowerToys, Paint, or a designer's spec sheet, dropping it into the HEX field gives you the exact channel numbers you need for the image editor or stylesheet on the other end of the workflow.

rgb to hex on windows
RGB to HEX on Windows: From Picker to Stylesheet

How to Convert RGB to HEX on Windows in Your Browser

Windows ships with everything you need for the workflow: a modern browser (Edge by default, plus Chrome and Firefox if you have them installed) and a handful of built-in tools that already speak RGB. Paint's color editor shows channel values, PowerToys' Color Picker captures any pixel on screen and copies its HEX, and design apps like PowerPoint or Photoshop list R/G/B numerically in their color pickers. The browser converter sits in the middle of that workflow: it takes whatever number you have and hands back the format you need next.

  1. Open your browser of choice (Edge, Chrome, or Firefox) and navigate to the RGB to HEX converter.
  2. If you captured the color with PowerToys Color Picker (Win+Shift+C), the copied value lands in your clipboard as a HEX code — paste it straight into the HEX field. The RGB and HSL readouts update immediately.
  3. If you copied RGB numbers from Paint (Edit Colors > Custom), Photoshop, or a designer's spec sheet, type them into the Red, Green, and Blue inputs. The matching #RRGGBB code appears in the HEX field within the same panel.
  4. Confirm the live swatch matches the shade you expected — Paint swatches and PowerToys captures can look slightly different depending on monitor calibration, so the preview is your ground truth.
  5. Click Copy next to whichever format (HEX, RGB, or HSL) your next step needs — CSS, an image editor, or a brand sheet — and paste it where you want.

For a quick sanity check, the popular UI blue (59, 130, 246) becomes #3b82f6 — that's 59 in hex is 3b (3 × 16 + 11 = 59), 130 in hex is 82 (8 × 16 + 2 = 130), and 246 in hex is f6 (15 × 16 + 6 = 246). The result, written together, is #3b82f6. This is the same conversion the tool performs for every color, repeated for the three channels.

Reading a HEX Code: What Each Pair of Digits Means

HEX looks opaque until you see that each pair is just one RGB channel written in base-16. The first two characters after the # are red, the middle two are green, and the last two are blue. Each pair ranges from 00 (decimal 0, channel off) to FF (decimal 255, channel fully on), so every visible shade on a standard monitor can be expressed in those six characters. The 24-bit space — 256 × 256 × 256 — covers 16,777,216 distinct colors, which is the same palette CSS, HTML, design tools like Figma and Photoshop, and most style guides rely on, which is why translating between the two formats is such a common everyday task for developers and designers.

Because hex digits go from 0 to f instead of 0 to 9, you do need a quick mental table: 0 is 0, 1 is 1, through 9 is 9, a is 10, b is 11, c is 12, d is 13, e is 14, and f is 15. To decode any pair, multiply the first digit by 16 and add the second. So #3b is 3 × 16 + 11 = 59, which is the red channel of #3b82f6. Once you can read one pair, you can read any of them — the converter just automates that arithmetic for all three channels at once.

For a deeper walkthrough of each pair's meaning and how the digits combine, the RGB to HEX explained guide covers the same idea with more worked examples.

Going the Other Way: Converting HEX Back to RGB

The converter is genuinely two-way. If you have a HEX code — from a CSS file, a designer, or a brand guide — paste it into the HEX field and the Red, Green, and Blue inputs update to the matching channel values. The HSL readout also appears next to the live swatch, which is useful when you want to reason about the color in human terms: hue as a 0–360° angle around the color wheel, and saturation and lightness as 0–100% amounts. That makes it easy to nudge a brand color a little lighter or more muted without guessing at raw channel numbers, then convert the result straight back to a HEX code your stylesheet can use.

This direction is most useful on Windows when you have a stylesheet value and need to drop it into Paint or Photoshop. Designers frequently ask "what's the RGB for this brand blue?" — and pasting the HEX gives an exact answer rather than guessing by eye from a swatch on screen.

Common RGB and HEX Reference Values

ColorRGBHEX
Black000#000000
White255255255#ffffff
Pure red25500#ff0000
Pure green02550#00ff00
Pure blue00255#0000ff
UI blue59130246#3b82f6

These six rows anchor the entire 24-bit space: every other color is a blend or a step between them. Pure red (#ff0000) is the red channel at full brightness with green and blue at zero; the popular UI blue (#3b82f6) is what you get when red sits at about 23% (59/255), green at about 51% (130/255), and blue at about 96% (246/255). If you only memorize the primaries, you can sanity-check almost any color by reasoning about the channel mix. For everyday conversions beyond these anchors, the converter on the same page gives the answer in a click.

HEX Shorthand, Case Rules, and Other Small Details

Three-digit shorthand works the same way the long form does — each digit is simply doubled. So #abc becomes #aabbcc (a→aa, b→bb, c→cc), #f00 becomes #ff0000 (pure red), and #fff becomes #ffffff (white). Input is case-insensitive and the leading # is optional, so ABC, #abc, and abc all resolve to the same color. Output HEX is always normalized to lowercase six-digit form with each channel zero-padded, so a value of 0 renders as 00 rather than a bare 0 — a detail that trips up hand-written conversions and occasionally catches out code that expects the padded form.

Out-of-range or fractional channel values are clamped to the valid 0–255 integer range instead of throwing an error, and any malformed HEX (wrong length, illegal characters) is flagged clearly rather than producing a silent wrong color. Both behaviors matter on Windows because values pasted from different apps are inconsistent: PowerToys sometimes omits the leading #, image editors occasionally output decimal floats like 59.0 instead of integers, and design specs occasionally drift above 255 from a rounding error in an upstream pipeline.

ShorthandExpanded
#abc#aabbcc
#f00#ff0000
#fff#ffffff
#0f8#00ff88

The shorthand doubling rule is the only transformation the long form requires. Everything else — channel order, base, padding — is identical.

Why a Browser Converter Is the Right Fit on Windows

The alternative on Windows is usually a desktop color utility — a built-in snippet like the PowerToys Color Picker for capture, or a heavyweight app like Photoshop for editing. Both are useful, but neither is great at the in-between step of converting between formats. The browser tool fills that gap without an install: open it in a tab, paste or type, copy, close the tab. Because everything happens locally in JavaScript, no color values are ever uploaded to a server, so it is safe for brand palettes and unreleased work — a meaningful consideration when the colors you're converting are under embargo or belong to a client.

On a Windows PC with Edge already open, the whole flow is two clicks and a paste — fast enough to keep alongside your design tool or stylesheet editor for the duration of a project. The same page handles the reverse direction (HEX to RGB), reads HSL alongside the RGB values, and shows the live swatch so you can confirm a shade before committing it to a file.

For a deeper look, see RGB to HSV Explained: The Formula Behind the Conversion.