ImageColorPick

HEX to RGB Converter

To convert HEX to RGB, split the code into three pairs and turn each pair into a number from 0 to 255: first digit times 16 plus the second digit. #1E90FF becomes rgb(30, 144, 255). Paste a hex code below to get RGB, HSL and CMYK with a live color preview.

HEX to RGB converter

The live converter needs JavaScript. Example: #FF6347 = rgb(255, 99, 71) = hsl(9, 100%, 64%) = cmyk(0%, 61%, 72%, 0%).

The formula

HEX to RGB, step by step
StepWhat to doExample: dodger blue
1Split the six digits into three pairs.#1E90FF → 1E, 90, FF
2Convert each pair: first digit × 16 + second digit (A=10 … F=15).1×16+14 = 30, 9×16+0 = 144, 15×16+15 = 255
3Write as rgb(R, G, B).rgb(30, 144, 255)
RGB to HSL, step by step
StepWhat to doExample: dodger blue
1Divide R, G, B by 255; find max and min.max 1.0, min 0.118
2L = (max + min) / 2.L = 0.559 → 56%
3S = (max − min) / (1 − |2L − 1|).S = 1.0 → 100%
4H from which channel is max (60° sectors).H = 210°

Three-digit codes are expanded first by doubling each digit: #F80 becomes #FF8800, which is rgb(255, 136, 0). An eight-digit code has a fourth pair for transparency, which this converter leaves out.

Example conversions

HEX to RGB and HSL
ColorHEXRGBHSL
Red#FF0000255, 0, 00°, 100%, 50%
Lime green#00FF000, 255, 0120°, 100%, 50%
Blue#0000FF0, 0, 255240°, 100%, 50%
White#FFFFFF255, 255, 2550°, 0%, 100%
Black#0000000, 0, 00°, 0%, 0%
Mid gray#808080128, 128, 1280°, 0%, 50%
Dodger blue#1E90FF30, 144, 255210°, 100%, 56%
Tomato#FF6347255, 99, 719°, 100%, 64%
Gold#FFD700255, 215, 051°, 100%, 50%
Rebecca purple#663399102, 51, 153270°, 50%, 40%
Teal#0080800, 128, 128180°, 100%, 25%
Saddle brown#8B4513139, 69, 1925°, 76%, 31%

HSL rounded to whole numbers. CMYK from the simple formula below, without a color profile.

Where RGB numbers are needed

  • Microsoft Word, Excel and PowerPoint custom colors.
  • Many video editors, game engines and 3D programs.
  • Programming libraries that take three numbers or values from 0 to 1 (divide by 255).
  • CSS also accepts rgb(30 144 255) with spaces, if you prefer numbers to hex.

Frequently asked questions

How do I convert hex to RGB?

Split the six digits into pairs for red, green and blue. For each pair, multiply the first digit by 16 and add the second, counting A as 10 up to F as 15. #FF6347 gives 255, 99 and 71.

What is #000000 in RGB?

#000000 is rgb(0, 0, 0), which is black: no red, green or blue light. #FFFFFF is rgb(255, 255, 255), white, and #FF0000 is rgb(255, 0, 0), pure red.

Does the converter accept short hex codes?

Yes. Type a three-digit code like #0AF and it is expanded to #00AAFF, which is rgb(0, 170, 255). You can write the code with or without the # and in upper or lower case.

What is HSL and why is it shown?

HSL means hue, saturation and lightness. It describes the same color in a way that is easier to adjust by hand: change only L to get a lighter or darker shade of the same color. CSS understands hsl() directly.

Can I paste rgb() or hsl() text?

Yes. The "Paste any code" field accepts a hex code, text like rgb(30, 144, 255) or hsl(210, 100%, 56%), and fills in all the other formats from it.

Last updated: October 15, 2026