Free Online RGB to HEX Color Converter

Convert RGB color codes to HEX instantly, with a live preview, the formula and a table of common colors.

Converter

HEX, RGB, HSL, HSV & CMYK — All At Once

Drag the sliders, pick a swatch, or type a hex code - every format updates live

HEX
RGB
HSL
HSV
CMYK

Results are provided for informational purposes only and may contain errors. Please verify important information independently. Use of this tool is at your own risk.

How to convert RGB to HEX

Convert RGB color codes to HEX instantly. Enter a HEX or RGB value, or use the sliders, and every format updates at once, with a live preview, the formula and a table of common colors.

  1. Type or paste a RGB value, such as rgb(59, 130, 246), into its field above.
  2. The HEX value updates immediately: rgb(59, 130, 246) is #3B82F6. The other formats and the color preview update too.
  3. Copy the HEX value into your CSS, design tool or code.

The RGB to HEX formula

Convert each RGB channel (0-255) to a two-digit hexadecimal number and write them after a #, in the order red, green, blue:

rgb(59, 130, 246) → #3B82F6

Common colors in RGB and HEX

RGBHEX
rgb(0, 0, 0)#000000
rgb(255, 255, 255)#FFFFFF
rgb(255, 0, 0)#FF0000
rgb(0, 255, 0)#00FF00
rgb(0, 0, 255)#0000FF
rgb(255, 255, 0)#FFFF00
rgb(0, 255, 255)#00FFFF
rgb(255, 0, 255)#FF00FF
rgb(128, 128, 128)#808080
rgb(255, 165, 0)#FFA500
rgb(128, 0, 128)#800080
rgb(59, 130, 246)#3B82F6

RGB and HEX explained

RGB gives the red, green and blue channels as numbers from 0 to 255, as in rgb(59, 130, 246). It is the model screens use to mix light.

A HEX color is a # followed by six hexadecimal digits: two each for red, green and blue, from 00 (none) to FF (full). It is the most common way to write colors in CSS and design tools.

Frequently asked questions

Does converting change the color?

HEX, RGB and HSL describe the same screen colors, so converting between them is exact (HSL is rounded to whole numbers). CMYK is for print: the printed result depends on the printer's color profile, so treat screen-to-CMYK values as a starting point.

Can I use the result in CSS?

Yes. CSS accepts hex (#3B82F6), rgb(59, 130, 246) and hsl(217, 91%, 60%) directly. CMYK is not a CSS format; it is used in print and design software.

What about transparency?

Add an alpha value: 8-digit hex (#3B82F680) or rgba()/hsla() in CSS. The converter works with the solid color; the alpha value stays the same in every format.

Is this tool free?

Yes, it's free to use. No signup, no email required. Get results on this page.

How do I get my result?

Use the tool on this page. Your result appears here; no email delivery is required.