Skip to content

Hex to RGB Converter

Paste a hex code, with or without the #, and see its red, green and blue values. Each pair of hex digits is worked out on screen, so you can check it by hand.

v2026.10.13

With or without #: 3, 4, 6 or 8 digits. Any other format works too.

RGB of #E4572E

228, 87, 46

Vivid orange: red 228, green 87, blue 46 out of 255.

E414×16 + 4 = 228
575×16 + 7 = 87
2E2×16 + 14 = 46
  • HEX#E4572E
  • RGBrgb(228, 87, 46)
  • HSLhsl(14, 77%, 54%)
  • HSVor HSBhsv(14, 80%, 89%)
  • CMYKnaive, no profilecmyk(0%, 62%, 80%, 11%)
  • OKLCHoklch(63.7% 0.184 36.5)
  • LABCIELAB, D65lab(55.6% 52.8 50.7)
  • CSS nameclosestchocolate
How this works: Method, 8 sources, Checked against 2 worked examples,

How this works

Method

A hex colour code is the three RGB numbers written in base 16, two digits each. In #1E90FF the pairs are 1E for red, 90 for green and FF for blue. Base 16 uses the digits 0 to 9 and then A to F for 10 to 15, so a pair runs from 00 (0) to FF (255), exactly the range of one 8-bit colour channel. Full method

How it’s tested

2 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.

Changes

  • Added eight pages: a colour picker for photos, a WCAG 2.2 and APCA contrast checker, a palette generator, a colour blindness simulator, and hex, RGB and CMYK converters.
  • Redesigned: paste a colour in any format, HSV and CMYK added, opacity, a contrast check against white and black text, and colour harmonies.
  • Fixed a crash when opening the colour picker.
  • First published.

Every change on What’s new

How we make toolsReport a mistake

How to convert hex to RGB

A hex colour code is the three RGB numbers written in base 16, two digits each. In #1E90FF the pairs are 1E for red, 90 for green and FF for blue. Base 16 uses the digits 0 to 9 and then A to F for 10 to 15, so a pair runs from 00 (0) to FF (255), exactly the range of one 8-bit colour channel.

To convert a pair, multiply the first digit by 16 and add the second. 1E is 1 × 16 + 14 = 30, 90 is 9 × 16 + 0 = 144 and FF is 15 × 16 + 15 = 255, so #1E90FF is rgb(30, 144, 255), the CSS colour dodgerblue. The working above does the same for whatever code is in the box.

Short codes double each digit: #F80 is #FF8800, rgb(255, 136, 0). Codes with eight digits (or four in the short form) add an alpha pair for opacity at the end, where FF is fully opaque and 80 is about 50%. Capital and small letters mean the same thing, and the # is only there to mark the value as hex in CSS.

channel = first digit × 16 + second digit

Common hex codes in RGB

Well-known colours with their hex code, RGB values and CSS name, converted by the same code as the tool.

Well-known colours with their hex code, RGB values and CSS name, converted by the same code as the tool.
HexRGBColour
#FF0000rgb(255, 0, 0)Vivid red
#00FF00rgb(0, 255, 0)Vivid green
#0000FFrgb(0, 0, 255)Vivid blue
#FFFFFFrgb(255, 255, 255)Near white
#000000rgb(0, 0, 0)Near black
#808080rgb(128, 128, 128)Grey
#FFA500rgb(255, 165, 0)Vivid orange
#FFD700rgb(255, 215, 0)Vivid yellow
#800080rgb(128, 0, 128)Dark purple
#008080rgb(0, 128, 128)Dark teal
Show all 14 rows
#FFC0CBrgb(255, 192, 203)Light red
#A52A2Argb(165, 42, 42)Red
#1E90FFrgb(30, 144, 255)Vivid blue
#2E8B57rgb(46, 139, 87)Green

Frequently Asked Questions

How do I convert #FFFFFF to RGB?

Each pair is FF, which is 15 × 16 + 15 = 255, so #FFFFFF is rgb(255, 255, 255), white. Likewise #000000 is rgb(0, 0, 0), black, and any code with three equal pairs, such as #808080, is a neutral grey.

What does a three-digit hex code mean?

It is shorthand: each digit is written twice. #09C becomes #0099CC, which is rgb(0, 153, 204). Only colours whose pairs are doubled digits can be written this way, which is why most brand colours need all six.

What are the last two digits of an eight-digit hex code?

They are the alpha, or opacity: 00 is fully transparent, FF fully opaque, and 80 (128) about half. #1E90FF80 is dodgerblue at 50% opacity, rgba(30, 144, 255, 0.5) in the older CSS syntax.

Is hex the same as RGB?

Yes, the same three numbers in a different base. Hex is compact and easy to paste; rgb() is easier to read and edit by hand. Both describe a colour in the sRGB colour space that screens and the web use.