RGB to HEX Converter

Turn RGB values into a hex colour code, with HSL, HSV and CMYK shown alongside.

Runs in your browser. Nothing you type is sent to a server.

How to use RGB to HEX Converter — Free Online Color Code Tool

  1. 1Type a hex code, RGB or HSL value, or a CSS colour name — or pick from the swatch.
  2. 2Every format is listed at once: HEX, RGB, HSL, HSV and CMYK.
  3. 3Copy the notation you need, or click a tint or shade to carry on from it.

About RGB to HEX

Design tools tend to report colours as RGB while stylesheets tend to want hex, so this conversion comes up constantly. It is the same colour either way — three channel values, written in a different base.

The input here is deliberately forgiving, because RGB arrives in several shapes: comma-separated, space-separated, with or without the rgb() wrapper, sometimes with percentages, sometimes with a fourth alpha value. All of those are accepted rather than rejected on a formatting technicality.

If you are going the other way, or want to see the whole colour in every notation at once, the full colour converter covers HEX, RGB, HSL, HSV and CMYK together.

Frequently asked questions

How do I convert RGB to hex manually?
Write each of the three numbers in base 16 and pad to two digits. 30, 144, 255 becomes 1E, 90, FF — so #1E90FF.
What format should I type?
Either comma or space separated, with or without the rgb() wrapper. Percentages work too, and a fourth value is read as alpha.
Can hex represent transparency?
Yes, in the 8-digit form #rrggbbaa. If you enter an alpha value it is converted; otherwise the colour is treated as fully opaque.
Is hex or RGB better in CSS?
Neither — browsers treat them identically. Hex is more compact, RGB is easier to compute with, and rgb() with a slash is required if you want to set opacity inline.
Is it free?
Yes — unlimited use, no sign-up, no watermark and no limit on how many times you run it.