/

RGB to HEX Converter

Processed Client Side

Enter RGB color values with the sliders or the color picker and instantly get the hexadecimal code, with a live preview.

RGB values
rgb(124, 92, 255)
Red
Green
Blue
HEX output
HEX
Hex#7c5cff
color: #7c5cff;

Bookmark this tool now — skip the search next time you need it.

About RGB to HEX converter

This tool runs entirely in your browser. Whatever you paste is processed on your own device and is never uploaded, logged, or sent to any server.

Convert RGB colour values to a hexadecimal code, with sliders and a colour picker for choosing the value visually. Hex is the compact form you paste into CSS, while RGB is the form you get from a design tool, a screenshot dropper, or a value your code computed — so this conversion comes up constantly. The three channels are each 0-255 and map onto two hex digits apiece, so 255, 128, 0 becomes #FF8000. The preview swatch updates live, which makes it useful for eyeballing a colour as well as converting one. The rgb() notation is printed next to the picker as you work, so the pane doubles as a two-way reference: nudge a slider and watch both representations of the same colour move together.

Key features

  • Per-channel sliders for red, green, and blue across the full 0-255 range
  • Native colour picker for choosing a colour visually rather than numerically
  • Live swatch preview of the current value
  • Outputs a standard six-digit hex code ready for CSS
  • Channel values stay editable as numbers when you need precision
  • Live rgb() notation shown beside the picker, so both forms of the colour are on screen at once
  • Sliders and the picker stay in sync, so a colour chosen visually can still be fine-tuned one channel at a time
  • One-click copy of the hex result
  • Runs entirely in your browser

How to use it

  1. Set the red, green, and blue values with the sliders, or open the colour picker.
  2. Watch the swatch until it is the colour you want.
  3. Read the hex code.
  4. Copy it into your stylesheet.

Tips & common mistakes

  • Each channel is one byte, which is why the range stops at 255 and maps to exactly two hex digits — 255 is FF, the largest two-digit hex value.
  • Hex and RGB describe exactly the same colours. Neither is more capable; hex is just more compact to write and RGB is easier to compute with.
  • Use RGB rather than hex when you are interpolating or animating colours in JavaScript, because hex is a string and cannot be averaged directly.
  • A hex code where all three pairs match — #333333, #EEEEEE — is a pure grey. That is a quick way to check whether a colour has an unintended tint.
  • For building a colour scale with consistent lightness steps, neither RGB nor hex will help much. HSL or OKLCH is the right space for that.
  • This tool goes one way; HEX to RGB handles the reverse, including alpha in 4 and 8-digit hex.
  • Three-digit hex is shorthand for six, with each digit doubled: #F80 is exactly #FF8800. It only works when both digits of every pair match, which is why most computed colours have no short form.
  • Hex is case-insensitive, so #ff8000 and #FF8000 are the same colour to a browser. Pick one convention and stay with it, since a mixed stylesheet makes duplicated values much harder to spot.
  • Going the other way — hex to `rgb()` — use the HEX to RGB converter.
  • Need to fold an alpha channel into the hex value too? Use RGBA to HEX converter.

Related tools

Browse all 19 Frontend / CSS tools

Frequently asked questions

9

Set the Red, Green, and Blue values with the sliders or number fields, or pick a color with the swatch. The six-digit #RRGGBB hex code updates instantly and can be copied with one click.

Each channel becomes two hex digits: 255 is FF and 0 is 00, so rgb(255, 0, 0) is #FF0000 (red). Enter any values in the tool and it does the conversion for you.

This tool handles opaque RGB. For a color with an alpha channel, use the RGBA to HEX converter, which produces an 8-digit #RRGGBBAA code.

No. All conversion runs locally in your browser, so nothing you enter is uploaded.

Each channel is one byte, and 255 is the largest value a byte holds. It maps to exactly two hex digits, which is why 255 becomes FF.

Neither is more capable — they describe exactly the same colours. Hex is more compact to write, RGB is easier to compute with in code.

All three hex pairs will match, as in #333333 or #EEEEEE. If they differ even slightly, the grey has a colour tint.

RGB. Hex is a string and cannot be averaged, while RGB gives you three numbers you can interpolate between directly.

Use the HEX to RGB converter, which also handles 4 and 8-digit hex with an alpha channel.