RGB to HEX Converter
Convert RGB channel values into a HEX code.
Input
This tool runs entirely in your browser. The data you paste or load is never uploaded.
Result
Enter your input, then run the tool.
About this tool
Converts red, green and blue channels, plus an optional alpha value, into a HEX colour string and a CSS rgb()/rgba() declaration. Out-of-range values are clamped and flagged.
How to use it
- Enter the three channel values between 0 and 255.
- Add an alpha value if the colour needs transparency.
- Copy the HEX or CSS output.
Frequently asked questions
How are values above 255 handled?
They are clamped to 255 with a note, rather than producing an invalid colour.
Which format should I use?
HEX is compact and widely supported; rgb() with a percentage or alpha is easier to read in newer stylesheets.
Keep going
Related tools
HEX to RGB Converter
Convert HEX colour codes to RGB and HSL.
RGB to HSL Converter
Convert RGB channels to hue, saturation and lightness.
Color Palette Generator
Generate harmonious palettes from one base colour.
Color Contrast Checker
Test text and background colours against WCAG 2.2.
CSS Gradient Generator
Build linear and radial gradients with copy-ready CSS.
CSS Box Shadow Generator
Design layered shadows and copy the CSS.