RGB to Hex Converter
RGB to Hex Converter converts red, green and blue values into a hex colour code, and shows the matching RGB and HSL values at the same time. It is a quick way to move a colour between design tools and CSS.
Share this page:
RGB to Hex Converter converts red, green and blue values into a hex colour code, and shows the matching RGB and HSL values at the same time. It is a quick way to move a colour between design tools and CSS.
RGB to Hex Converter at a glance
- Convert a colour picked from an image into a hex code for a stylesheet.
- Match a brand colour across a design file and a web page.
- Find a lighter or darker variant by adjusting one channel at a time.
Step by step
- Set the red, green and blue levels between 0 and 255 using the sliders or number fields.
- Watch the Hex Value, RGB Value and HSL Value update as you adjust the channels.
- Copy the format your project needs, such as #1E90FF for CSS.
Accuracy, limits and privacy
Hex codes are device-independent values, but screens render them differently. Check important brand colours on a calibrated display.
How it works in practice
Hex and RGB describe the same colour in different notation. The HSL view is more useful when you want to lighten or desaturate a colour without shifting its hue.
Where people go wrong
- Entering values above 255 or below 0.
- Expecting the hex code to include an alpha channel; it represents solid colour only.
Common questions
What does each channel control?
Red, green and blue each add light. All three at 255 produce white, all three at 0 produce black, and equal mid values produce grey.
Why does HSL look different from RGB?
HSL describes the same colour by hue, saturation and lightness, which is often easier to reason about when building a palette.
Can I paste a hex code to convert back?
This page is built for RGB to hex direction. Use a hex-to-RGB converter for the reverse, or read the RGB values shown beside the hex output.
Related Tools
More free tools you may like