Skip to content

Hex to RGB Converter

A hex color code is three pairs of base-16 digits: red, green and blue. Read each pair as a number from 0 to 255 and you have the RGB value, so #FF5733 is rgb(255, 87, 51). Paste any hex code below to convert it instantly in your browser.

Hex to RGB example

#FF5733 = rgb(255, 87, 51)

Red FF = 255 · Green 57 = 87 · Blue 33 = 51

  • #FFFFFF = rgb(255, 255, 255) (white)
  • #000000 = rgb(0, 0, 0) (black)
  • #FF0000 = rgb(255, 0, 0) (red)
  • #00FF00 = rgb(0, 255, 0) (lime)
  • #0000FF = rgb(0, 0, 255) (blue)
  • #808080 = rgb(128, 128, 128) (gray)
More values in the hex to RGB chart below. Going the other way? Use the RGB to hex converter.

Synchronized color

#FF5733

Parsed as RGB; malformed or out-of-range channels are rejected, never silently clamped.

Integer or percentage RGB, modern or legacy CSS, Hex with optional alpha, HSL, HSV, OKLCH, LAB, LCH, CMYK, or a CSS name.

100%

Adjust channels

255
87
51

Share this exact input

?color=FF5733

One input, implementation-ready output

Color workspace

Hex

#RRGGBB

#FF5733

CSS RGB

Modern space syntax

rgb(255 87 51)

Legacy RGB

Comma syntax

rgb(255, 87, 51)

RGB %

Percentage channels

rgb(100% 34.1% 20%)

HSL

CSS hue, saturation, lightness

hsl(11 100% 60%)

HSV / HSB

Design-tool model

hsv(11, 80%, 100%)

OKLCH

Perceptual CSS color

oklch(68.04% 0.21 33.69)

LAB

CSS Lab, D50

lab(61.03% 63.55 55.96)

LCH

CSS LCH, D50

lch(61.03% 84.67 41.37)

CMYK

Unprofiled approximation

cmyk(0%, 66%, 80%, 0%)

Hex to RGB Chart: 24 Common Colors

Hex codes and their RGB values for the most commonly used colors. Click any hex code to load it into the converter above, or a color name for its full breakdown.

ColorNameHexRGB
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)
Pink#FFC0CBrgb(255, 192, 203)
Gold#FFD700rgb(255, 215, 0)
Brown#A52A2Argb(165, 42, 42)
Coral#FF7F50rgb(255, 127, 80)
Indigo#4B0082rgb(75, 0, 130)
Violet#EE82EErgb(238, 130, 238)
Salmon#FA8072rgb(250, 128, 114)

Need a value that is not listed? Browse the full color library — every hex code has a page with its RGB, HSL, CMYK and OKLCH values, contrast ratios, tints, shades and matching palette colors.

How to Convert Hex to RGB

A hex color code is three hexadecimal (base-16) numbers written back to back. Converting to RGB is just reading each pair as a decimal number:

  1. Split the 6-digit hex code into three pairs: RR (red), GG (green), BB (blue).
  2. Convert each pair from hexadecimal to decimal: multiply the first digit by 16 and add the second digit (A=10, B=11, C=12, D=13, E=14, F=15).
  3. Each result is a channel value from 0 to 255.
  4. Write the result as rgb(R, G, B).

Example: convert #FF5733 to RGB

FF → (15 × 16) + 15 = 255 (red)

57 → (5 × 16) + 7 = 87 (green)

33 → (3 × 16) + 3 = 51 (blue)

Result: rgb(255, 87, 51)

How to Use the Hex to RGB Converter

Enter your hexadecimal color code in the input field with or without the # symbol: #FF5733, FF5733, and the shorthand #F53 all work. The converter instantly displays the RGB equivalent, CSS rgb() output, HSL, OKLCH, and CMYK values. Click any copy button to copy the value to your clipboard. Your recent colors are saved for quick access.

Understanding Hex Color Codes

Hexadecimal color codes are six-digit codes that represent colors using base-16 notation. The first two digits represent red, the middle two represent green, and the last two represent blue. Each pair can range from 00 (0) to FF (255), creating over 16 million possible colors. This format was introduced in HTML 3.2 and remains the most common way to specify colors in web design.

Common Use Cases

Web developers use hex to RGB conversion when working with JavaScript color manipulation, CSS variables, or APIs that require RGB format. Designers often need to convert between formats when moving between different design tools. The RGB format is particularly useful for calculating color blends, adjusting brightness, and working with transparency.

Frequently Asked Questions about Hex to RGB Converter

Hex (hexadecimal) uses a 6-character code starting with # to represent colors (e.g., #FF5733), while RGB uses three decimal numbers from 0-255 for red, green, and blue channels (e.g., rgb(255, 87, 51)). Both represent the same colors, just in different notation systems.