How to Convert HEX to RGB Color Codes

· 3 min read

HEX and RGB are two ways of writing the exact same colors. Designers and developers switch between them constantly — HEX in CSS stylesheets, RGB in JavaScript animations, HSL in design tools. Understanding how they relate makes color work much easier.

How HEX colors work

A HEX color code like #FF5733 is a 6-digit hexadecimal number that represents red, green, and blue channels:

Part Hex Decimal Channel
FF FF 255 Red
57 57 87 Green
33 33 51 Blue

Each channel ranges from 00 (0, no color) to FF (255, full intensity). So #FF5733 means full red, some green, a little blue — which gives you a warm orange-red.

How to convert HEX to RGB

  1. Enter your HEX code — type or paste a color code like #FF5733 or use the color picker.
  2. View the RGB values — see the equivalent red, green, and blue values (0-255 each).
  3. Copy in any format — grab the values as rgb(255, 87, 51), individual channels, or other formats like HSL.

Common color codes

Color HEX RGB
White #FFFFFF rgb(255, 255, 255)
Black #000000 rgb(0, 0, 0)
Red #FF0000 rgb(255, 0, 0)
Green #00FF00 rgb(0, 255, 0)
Blue #0000FF rgb(0, 0, 255)
Yellow #FFFF00 rgb(255, 255, 0)

Tips

Frequently Asked Questions

How do I convert HEX to RGB manually?

Split the 6-digit hex code into three pairs (e.g.,

What about 3-digit HEX codes?

Three-digit hex is shorthand where each digit is doubled.

When should I use HEX vs RGB?

HEX is more compact and widely used in CSS. RGB is better when you need to manipulate individual color channels programmatically or use rgba() for transparency. Both represent the same colors.

What is the

The hash (#) is a prefix that identifies the value as a hexadecimal color code. It is not part of the color value itself. Some tools accept HEX codes with or without the hash.