RGB to HEX Converter
Use this RGB to HEX converter to turn red, green and blue values into a hex code like #3b82f6 for CSS and design tools. It updates live in your browser, with nothing uploaded and no sign-up.
Pick or paste a color
Edit any field — HEX, RGB, HSL, HSV, CMYK or OKLCH — and the rest update instantly. Copy the CSS string you need.
How to convert RGB to HEX
Enter your RGB values
Type the red, green and blue numbers (0 to 255) into the RGB fields, or pick a color with the picker.
Read the hex code
The matching hex value updates instantly, along with HSL, HSV, CMYK and OKLCH for the same color.
Copy the hex string
Copy the result, such as #3b82f6, and paste it into your CSS, design tool or asset.
Why convert RGB to HEX
RGB values are easy to read channel by channel, but most design files and CSS snippets use compact hex codes. This RGB to HEX converter turns your three numbers into a clean #rrggbb string, and works the other way too so you can paste a hex code and read back the channels.
The conversion is straightforward base-16 math on each 8-bit channel, so it is exact and reversible. It all runs on the page in your browser, which keeps it instant and means none of your colors are sent to a server.
Frequently asked questions
How do I convert RGB to a hex code?
Enter the red, green and blue values and read the hex code, which updates as you type. You can copy it as a CSS-ready #rrggbb string.
What range should the RGB numbers be in?
Each channel runs from 0 to 255, the standard 8-bit sRGB range used by CSS and most design tools.
Can I convert hex back to RGB too?
Yes. The converter is two-way, so editing the hex field updates the RGB values automatically.
Will the hex code be uppercase or lowercase?
It is shown in a standard form you can paste directly into CSS; case does not affect how the color is rendered.
Is my color sent to a server?
No. The RGB to HEX conversion happens entirely in your browser with no upload and no sign-up.