RGB to HEX Converter
Enter an RGB color such as rgb(26, 115, 232) to get its HEX code.
Free · Runs in your browser · Your text is never uploaded
How RGB becomes HEX
Convert each of red, green and blue (0–255) to two hex digits and join them after a #. For rgb(26, 115, 232): 26 is 1A, 115 is 73 and 232 is E8, giving #1a73e8.
Input styles
You can also type 26 115 232, rgb(10% 20% 30%) or rgba(26, 115, 232, 0.8).
Where this conversion helps
Designers copy RGB values from an editor or screenshot and need the HEX code for CSS, email templates or style guides.
Common colors for reference
These values come from the CSS standard:
| Color | HEX | RGB | HSL |
|---|---|---|---|
| Black | #000000 | 0, 0, 0 | 0, 0%, 0% |
| White | #ffffff | 255, 255, 255 | 0, 0%, 100% |
| Red | #ff0000 | 255, 0, 0 | 0, 100%, 50% |
| Lime | #00ff00 | 0, 255, 0 | 120, 100%, 50% |
| Blue | #0000ff | 0, 0, 255 | 240, 100%, 50% |
| Yellow | #ffff00 | 255, 255, 0 | 60, 100%, 50% |
| Gray | #808080 | 128, 128, 128 | 0, 0%, 50% |
Check readability
A color is only useful if text stays legible on it. The converter shows contrast ratios against white and black; WCAG AA needs 4.5:1 for normal text. For a full explanation of every notation, see HEX, RGB and HSL color codes explained.
Need more options? Open the full Color Converter.
Related guides
Frequently asked questions
How do I convert RGB to HEX?
Enter the three numbers and read the HEX line.
What is the maximum value?
255 for each channel.