Color Converter
How to Convert RGB to Hex
RGB and hex describe the same colour two ways: rgb(37, 99, 235) is the same blue as #2563EB. Enter a colour below to convert between RGB, hex and HSL.
Convert a colour
HEX
#2563eb
RGB
rgb(37, 99, 235)
HSL
hsl(221, 83%, 53%)
Steps to convert RGB to hex
- Enter your RGB values (or pick a colour) in the tool above.
- Read the matching hex code, ready to paste into CSS.
- The HSL value is shown too, which is handy for tints and shades.
How the conversion works
A hex colour is just the red, green and blue values written in base 16, two digits each. For example 37 → 25, 99 → 63 and 235 → EB, giving #2563EB. The converter does this for you, including the reverse.
Frequently asked questions
What does the # mean in a hex colour?
The # simply marks the value as a hexadecimal colour in CSS and design tools. The six digits after it are the red, green and blue components.
Can I convert hex back to RGB?
Yes. Enter a hex code and the tool shows the equivalent RGB and HSL values.