RGB to HEX Converter
Convert RGB color values to a HEX code with live sliders and preview.
#2563eb
Set the red, green and blue channels with inputs or sliders and get the matching hex color code instantly. A live swatch previews the color, and you can copy the HEX or RGB string with one click — handy for CSS, design tokens and email templates.
How to use the RGB to HEX Converter
- Enter the R, G and B values (0–255), or drag the sliders.
- Watch the preview and HEX value update instantly.
- Copy the HEX or RGB string you need.
Frequently asked questions
How do I convert RGB to HEX manually?
Convert each channel (0–255) to a two-digit hexadecimal number and concatenate them. For example rgb(37, 99, 235) → #2563eb.
Does it clamp out-of-range values?
Yes. Values below 0 or above 255 are clamped to the valid range before conversion.