RGB to HEX
Convert rgb() color values to HEX codes.
- Reading time:
- 2 min
- Last updated:
- Price:
- Free, no signup
Type or paste text to see the result.
What the RGB to HEX does
Enter three numbers for red, green and blue — such as '255, 99, 71' — and get the matching hex code: #FF6347, the colour CSS calls 'tomato'.
Each value from 0 to 255 is converted to two hex digits and joined into a six-digit code ready to paste anywhere.
Why the RGB to HEX is useful
Colour pickers, screenshots and some design apps report RGB, while CSS, brand guides and most web tools prefer hex.
Hex codes are shorter to share in chat, documents and style guides, and less likely to be mistyped than three separate numbers.
Also known as: rgb to hex, color converter, free rgb to hex, online rgb to hex, rgb to hex online free, rgb to hex tool, best rgb to hex tool.
How to use the RGB to HEX
- 1
Type the RGB values
Three numbers 0–255, separated by commas or spaces.
- 2
Copy the hex code
It includes the leading '#'.
- 3
Use it
In CSS, a brand guide or a design tool.
Key features
- Accepts commas or spaces
- Accepts rgb(...) format
- Six-digit output with '#'
- Live conversion
Benefits
- Share colours in a compact format
- Match screenshots to your CSS
- Avoid manual base-16 conversion
Real-life use cases
Matching a logo colour
A small business owner reads rgb(0, 128, 96) from a colour picker on their logo and converts it to #008060 for their website builder.
Writing a style guide
A designer converts each palette swatch to hex so the guide lists one short code per colour.
Tips for the best results
- Values above 255 aren't valid — check for typos if the result seems off.
- Equal R, G and B values always give a grey.
- Pair this with the Color Contrast tools to check readability.
Conclusion
Turn RGB numbers into a clean hex code you can paste into CSS, brand guides and design tools.
Frequently asked questions
What is rgb(0, 0, 0) in hex?
- #000000, black.
Can I paste 'rgb(10, 20, 30)'?
- Yes, the numbers are read from that format too.
Is the output uppercase?
- Hex is case-insensitive, so either form works anywhere.
Does it handle transparency?
- No, it converts the three colour channels only.
What if I enter 300?
- That isn't a valid channel value; keep each number between 0 and 255.
How do I convert back?
- Use the Hex to RGB tool.
Related tools you may need
- HEX to RGB — Convert HEX color codes to RGB with alpha support.
- CMYK to RGB Converter — Convert print CMYK colors to screen RGB.
- HSL to HEX Converter — Convert HSL color values to HEX.
- HSL to RGB Converter — Convert HSL color values to RGB.
- Color Picker — Convert any CSS color into HEX, RGB and HSL representations.
- Colour Contrast Grid Generator — Preview WCAG contrast ratios for every colour pairing.
- Color Palette Generator — Generate a 5-shade palette from any HEX color.
- Dominant Colour Palette Extractor — Extract the dominant colours from any image as hex swatches.
Keep exploring
Browse the full tools directory, filter by category, or read guides on the Text Tools Hub blog.