Free HEX to RGB Converter

Paste any HEX color code and instantly get the RGB equivalent plus HSL, CMYK, and 7 other formats. Visual picker included.

Could not parse color

Color Preview

#000000

rgb(0, 0, 0)

hsl(0, 0%, 0%)

black

Color Picker

100%

All Formats

HEX

HEX (no #)

RGB

RGBA

HSL

HSLA

HSV/HSB

CMYK

CSS Name

Integer

Pro Tips

  • Type any format directly: #FF5733, rgb(255,87,51), coral
  • Use the color picker for visual selection, or combine both methods
  • Switch to Bulk CSS Converter to convert entire stylesheets at once
  • The CSS Name finder uses Euclidean distance to find the closest match from all 148 named colors
  • All 10 output formats update live as you type or pick

Last updated: March 2026

How to Convert HEX to RGB

Converting HEX to RGB is one of the most common tasks in web development and design. A HEX color code is a six-character hexadecimal representation of a color's red, green, and blue channels. Each pair of characters (e.g., FF, A0, 3C) represents a value from 0 to 255 in base-16 notation.

To use this converter, simply paste your HEX code into the input field above. The tool accepts codes with or without the hash symbol, in 3-digit shorthand (#F53), standard 6-digit (#FF5533), or 8-digit with alpha (#FF553380). The RGB value and nine other formats appear instantly.

Understanding the HEX Color System

HEX color codes use the hexadecimal (base-16) number system, where digits range from 0 to F. The code #2563EB breaks down as: 25 for red (37 in decimal), 63 for green (99), and EB for blue (235). This produces the vivid blue you see as the default color in the tool above.

The 3-digit shorthand works by doubling each digit: #F53 becomes #FF5533. This shorthand only works when each channel can be represented by a repeated digit, giving you 4,096 possible colors versus the full 16.7 million of the 6-digit format.

The 8-digit format adds two characters for alpha transparency. #FF573380 means the color #FF5733 at 50% opacity (80 in hex equals 128 in decimal, which is 128/255 or roughly 0.50).

HEX to RGB Conversion Formula

The math behind HEX to RGB conversion is straightforward base conversion. For a HEX code like #FF5733:

  • Red: FF = (15 × 16) + 15 = 255
  • Green: 57 = (5 × 16) + 7 = 87
  • Blue: 33 = (3 × 16) + 3 = 51

Result: rgb(255, 87, 51). This conversion is perfectly lossless — the same color is represented in both formats with zero rounding or approximation.

Common HEX to RGB Examples

Here are some frequently converted colors:

  • #FFFFFFrgb(255, 255, 255) — White
  • #000000rgb(0, 0, 0) — Black
  • #FF0000rgb(255, 0, 0) — Pure Red
  • #00FF00rgb(0, 255, 0) — Pure Green
  • #0000FFrgb(0, 0, 255) — Pure Blue
  • #808080rgb(128, 128, 128) — Gray

Frequently Asked Questions

How do I convert a HEX code to RGB?

A HEX color code like #FF5733 contains three pairs of hexadecimal digits representing red, green, and blue. To convert manually, split the code into pairs (FF, 57, 33) and convert each from base-16 to base-10: FF = 255, 57 = 87, 33 = 51. So #FF5733 becomes rgb(255, 87, 51). This tool does the conversion instantly — just paste any HEX code and the RGB value appears automatically.

What is the difference between 3-digit and 6-digit HEX codes?

A 3-digit HEX code is shorthand where each digit is doubled. For example, #F53 expands to #FF5533. The 6-digit form provides the same 16.7 million color range but is more explicit. There is also an 8-digit form (e.g., #FF573380) where the last two digits represent alpha transparency. This converter handles all three formats.

Can I convert HEX with transparency to RGBA?

Yes. Enter an 8-digit HEX code like #FF573380 and the tool will convert the last two characters to an alpha value between 0 and 1. The RGBA output will show the full value, such as rgba(255, 87, 51, 0.5). This is useful when working with semi-transparent colors in CSS.

Why do designers use HEX instead of RGB?

HEX codes are shorter and more compact, making them popular in CSS and design tools. A HEX code like #2563EB takes less space than rgb(37, 99, 235) and is easier to copy-paste. HEX is also the default format in most design applications like Figma, Sketch, and Photoshop. However, RGB is more readable when you need to understand or manipulate individual channel values.

Is the conversion from HEX to RGB lossless?

Yes, completely. HEX and RGB are two different notations for the same color model. Converting between them involves only a base conversion (hexadecimal to decimal) with no rounding or approximation. The color you see will be identical in both formats.

Related Tools