NathanTools
NathanTools
Text Tools 13
SEO Tools 7
Image Tools 19
YouTube Tools 38
Device Tests 4
PDF Tools 10
Calculators 52
Electrical Calculators 10
Time Tools 7
Random Tools 9
Converters 14
Developer Tools 11
Hash Generators 5
Password & Security 2
Network & DNS 3
Website Tools 9

RGB to HEX Converter

Set red, green and blue values from 0 to 255 to get the matching HEX colour code.

100% free No sign-up Works on any device
HEX
RGB
HSL
CMYK

Text contrast (WCAG)

Tints & shades

How RGB and HEX colour codes work

Screens mix red, green and blue light. Each channel is a number from 0 (off) to 255 (full), giving 256³ ≈ 16.7 million colours. A HEX code writes the same three numbers in hexadecimal, two digits each: #RRGGBB. So #FFFFFF is white, #000000 is black and #FF0000 is pure red.

ColourHEXRGB
White#FFFFFFrgb(255, 255, 255)
Black#000000rgb(0, 0, 0)
Red#FF0000rgb(255, 0, 0)
Lime#00FF00rgb(0, 255, 0)
Blue#0000FFrgb(0, 0, 255)
Yellow#FFFF00rgb(255, 255, 0)
Orange#FFA500rgb(255, 165, 0)
Grey#808080rgb(128, 128, 128)

When to use each format

  • HEX: the most common format in CSS, design tools and brand guidelines.
  • RGB / RGBA: handy when you need transparency, as in rgba(90, 63, 224, 0.5).
  • HSL: the easiest format for making a colour lighter or darker by changing one number.
  • CMYK: printing. The values here are a simple conversion; your printer's colour profile will vary.

Frequently asked questions

Convert each of the red, green and blue values (0–255) to a two-digit hexadecimal number and join them after a #. For example rgb(90, 63, 224) becomes 5A, 3F and E0, so #5A3FE0.

Split the six digits into three pairs and convert each pair from hexadecimal to decimal. #FF8800 is FF = 255, 88 = 136 and 00 = 0, which gives rgb(255, 136, 0). Paste any HEX code into the HEX field above to convert it.

A shorthand where each digit is doubled: #F80 means #FF8800. It only works for colours whose pairs repeat.

It measures how readable text is on a background, from 1:1 (invisible) to 21:1 (black on white). WCAG guidelines ask for at least 4.5:1 for normal text (AA) and 7:1 for the stricter AAA level.
All Converters
Esc
↑ ↓ to moveEnter to open