Enter the color
Type or paste a RGB code, or pick a color with the color picker.
Paste any RGB color and get its HEX value instantly, together with every other format: HEX, RGB, HSL, HWB, CMYK and OKLCH. Free, and it runs in your browser.
100% private — the calculation is done in your browser and nothing is sent to any server.
Keep going with your result in another tool. Nothing is uploaded.
Type or paste a RGB code, or pick a color with the color picker.
Every format updates as you type and shows a live preview of the color.
Use the copy button next to the format you need.
To convert RGB to HEX, enter your RGB color in the box above and read the HEX value next to it. For example, rgb(239, 68, 68) is #EF4444. The result updates as you type, and every other format (HEX, RGB, HSL, CMYK and more) is shown at the same time.
RGB describes a color as amounts of red, green and blue light, each from 0 to 255. rgb(59, 130, 246) is the same color as #3B82F6. CSS also accepts an opacity value, as in rgba(59, 130, 246, 0.5).
A HEX color is a six-digit hexadecimal code with a # in front: two digits each for red, green and blue, from 00 to FF. In #3B82F6, red is 3B, green is 82 and blue is F6. A three-digit shorthand such as #38F repeats each digit, and eight digits add opacity at the end.
Here is the calculation for rgb(239, 68, 68), step by step:
| Color | RGB | HEX |
|---|---|---|
| Black | rgb(0, 0, 0) | #000000 |
| White | rgb(255, 255, 255) | #FFFFFF |
| Red | rgb(255, 0, 0) | #FF0000 |
| Lime | rgb(0, 255, 0) | #00FF00 |
| Blue | rgb(0, 0, 255) | #0000FF |
| Yellow | rgb(255, 255, 0) | #FFFF00 |
| Cyan | rgb(0, 255, 255) | #00FFFF |
| Magenta | rgb(255, 0, 255) | #FF00FF |
| Gray | rgb(128, 128, 128) | #808080 |
| Orange | rgb(255, 165, 0) | #FFA500 |
| Purple | rgb(128, 0, 128) | #800080 |
| Pink | rgb(255, 192, 203) | #FFC0CB |
| Brown | rgb(165, 42, 42) | #A52A2A |
| Navy | rgb(0, 0, 128) | #000080 |
| Teal | rgb(0, 128, 128) | #008080 |
| Coral | rgb(255, 127, 80) | #FF7F50 |
RGB is the model screens use and the one CSS functions such as rgba() build on, which makes it handy when you need transparency or want to compute colors in code. HEX is the most compact way to write a color in CSS and design tools, so it is the code most people copy and share.
More utilities that also run without leaving your browser.