Skip to main content
ToolCube – All tools at one place.

HEX to RGB Converter

Paste a HEX color code to get its RGB values. Short codes such as #f60 and 8-digit codes with alpha work too.

  • HEX to RGB preselected
  • Every format with Copy
  • Contrast checker

Convert a color

Detected: HEX

RGB
HSL

All formats

  • RGBrgb(255, 102, 0)
  • HEX#ff6600
  • HSLhsl(24, 100%, 50%)
  • HSV / HSBhsv(24, 100%, 100%)
  • CMYKcmyk(0%, 60%, 100%, 0%)
  • Nameclosest: orangered
  • CSScolor: #ff6600;

CMYK values are an approximation for screen colors; printed colors depend on the printer profile.

Pick a color from an image

Upload a photo or screenshot (JPG, PNG, WebP, AVIF or iPhone HEIC), then click or tap any point to pick its color. The image stays on your device.

Want to recolor part of an image? Try Change Image Color.

Shades, tints and harmonies

Shades (darker)

  • #e85d00
  • #d15300
  • #b94a00
  • #a24100
  • #8b3800
  • #742e00
  • #5d2500
  • #461c00
  • #2e1300
  • #170900

Tints (lighter)

  • #ff7417
  • #ff822e
  • #ff9046
  • #ff9e5d
  • #ffac74
  • #ffb98b
  • #ffc7a2
  • #ffd5b9
  • #ffe3d1
  • #fff1e8

Harmonies

Complementary – Opposite on the color wheel (180°).

Analogous – Neighbours 30° either side.

Triadic – Three colors 120° apart.

Split-complementary – The two colors next to the complement (150° and 210°).

Tetradic (square) – Four colors 90° apart.

Contrast checker (WCAG)

  • Your color on white

    2.93:1

    Sample of your color as text on #ffffff: contrast 2.93:1.

    • AA normal: Fail
    • AA large: Fail
    • AAA normal: Fail
    • AAA large: Fail
  • Your color on black

    7.15:1

    Sample of your color as text on #000000: contrast 7.15:1.

    • AA normal: Pass
    • AA large: Pass
    • AAA normal: Pass
    • AAA large: Pass
  • Your color on #1e3a8a

    3.52:1

    Sample of your color as text on #1e3a8a: contrast 3.52:1.

    • AA normal: Fail
    • AA large: Pass
    • AAA normal: Fail
    • AAA large: Fail

Guide

How to convert HEX to RGB

  1. Remove the # and, for a 3-digit code, double each digit (#f60 becomes ff6600).
  2. Split the code into three pairs: red, green and blue.
  3. Convert each pair from hexadecimal to decimal: ff = 15 × 16 + 15 = 255, 66 = 6 × 16 + 6 = 102, 00 = 0.
  4. Write the result as rgb(255, 102, 0). An optional fourth pair is the alpha: divide it by 255.

What a HEX code really is

A HEX color code is simply RGB written in base 16. Each pair of digits holds one channel, from 00 (none of that light) to ff (full strength), which is 0 to 255 in everyday numbers. Because both formats store exactly the same information, converting HEX to RGB is lossless: every HEX code has exactly one RGB value and back again.

Designers like HEX because it is short and easy to copy from tools such as Figma or Photoshop. Developers often need RGB instead, for example to add transparency with rgba() or to calculate colors in code. That is the most common reason to convert.

Short codes and transparency

CSS allows a 3-digit shorthand when each pair has two identical digits: #f60 is the same as #ff6600, and #fff is white. A 4-digit or 8-digit code adds an alpha channel for transparency. #ff660080 is orange at 128 out of 255, about 50% opacity, which this converter shows as rgba(255, 102, 0, 0.5).

Case does not matter: #FF6600 and #ff6600 are identical. The # sign is optional when you paste a code here, but it is required when you write HEX colors in CSS.

Where you will meet HEX codes

HEX codes appear in website stylesheets, email templates, presentation themes and the color fields of almost every design app. Brand guides often list a HEX code next to each color. When a program asks for separate red, green and blue numbers instead, such as a spreadsheet chart, a video editor or a smart light app, converting to RGB gives the three values in one step.

Remember that the converter also shows HSL, HSV and CMYK for the same color, so you can copy whichever format the next program needs.

HEX to RGB chart of common colors

HEX to RGB values for common colors
ColorHEXRGB
Black#000000rgb(0, 0, 0)
White#ffffffrgb(255, 255, 255)
Red#ff0000rgb(255, 0, 0)
Lime#00ff00rgb(0, 255, 0)
Blue#0000ffrgb(0, 0, 255)
Yellow#ffff00rgb(255, 255, 0)
Cyan#00ffffrgb(0, 255, 255)
Magenta#ff00ffrgb(255, 0, 255)
Silver#c0c0c0rgb(192, 192, 192)
Gray#808080rgb(128, 128, 128)
Maroon#800000rgb(128, 0, 0)
Olive#808000rgb(128, 128, 0)
Green#008000rgb(0, 128, 0)
Purple#800080rgb(128, 0, 128)
Teal#008080rgb(0, 128, 128)
Navy#000080rgb(0, 0, 128)
Orange#ffa500rgb(255, 165, 0)
Tomato#ff6347rgb(255, 99, 71)

Other colors: use the converter above or the Color Converter.

FAQ

Frequently Asked Questions

Answers to common questions about HEX to RGB on ToolCube.

Is converting HEX to RGB exact?

Yes. HEX and RGB store the same three numbers in different bases, so the conversion never changes a color.

What is #fff in RGB?

#fff is the short form of #ffffff, which is rgb(255, 255, 255), pure white.

How do I convert an 8-digit HEX code?

The first six digits give the RGB values and the last two give the alpha. Divide the alpha by 255: #00000080 is rgba(0, 0, 0, 0.5).