Images & QR
RGB to Hex and Hex to RGB Converter
Convert RGB to hex or hex to RGB. Enter a three-channel RGB color, #RGB, or #RRGGBB and copy the exact CSS color values.
Tool workspace
ReadyYour input stays in this browser.
The tool is ready to run.
Run the tool when your input is ready.
Ready for a result
Run the tool to create the result.
Direct answer
What RGB to Hex and Hex to RGB Converter does
RGB and hexadecimal color codes describe the same three color channels. Each channel ranges from 0 through 255. Hex writes each channel as two base-16 digits, so RGB 255, 128, 0 equals #FF8000.
Output
What you receive
You receive a six-digit hex code, a CSS rgb() value, and the individual red, green, and blue channels.
Use this tool
How to convert RGB and hex colors
- Enter #RGB, #RRGGBB, or three comma-separated integers.
- Select Convert.
- Copy the RGB or hex value into your stylesheet or design document.
Processing
Calculate privately in your browser
This utility processes values locally. It does not send your input to a conversion service.
Worked example
Test RGB to Hex and Hex to RGB Converter with a safe sample
Input: rgb(255, 128, 0)
Settings: Three integer channels
Expected result
#FF8000
The shorthand #F80 represents #FF8800 instead, because each shorthand digit repeats.
Limits
Check before you use the result
- Use integer RGB channels from 0 through 255.
- Alpha, HSL, percentages, named colors, and image color sampling are not supported.
- This converter changes notation, not color profiles or display calibration.