Convert HEX to RGB

Convert HEX color codes to RGB values instantly. Enter any hex code and get the red, green, blue values. Free, browser-based.

Formula: R = hex[1-2], G = hex[3-4], B = hex[5-6] (as decimal)

Quick example: #2563EB → rgb(37, 99, 235)

Color Preview
#2563EB
Color Values
#
HEX
R
RGB
H
HSL
C
CMYK84%, 58%, 0%, 8%
A
Alpha
100%
T
Tailwind
blue-600#2563ebclose match
WCAG Contrast Checker
Foreground#2563eb
Background#ffffff
Contrast Ratio
5.17:1
Sample Text Preview
AA Large: PassAA Normal: PassAAA: Fail
Analogous Palette

About This Conversion

HEX and RGB are the two most common color formats in web development. HEX codes (#RRGGBB) are compact six-character strings used in CSS, while RGB specifies red, green, and blue channels as decimal values from 0 to 255. Converting between them is essential when translating designs from tools like Figma (which often shows hex) to CSS functions like rgba() where you need individual channel values for opacity control. Each pair of hex digits represents one color channel: the first two are red, middle two are green, and last two are blue.

Frequently Asked Questions

How do I convert HEX to RGB manually?
Split the hex code into three pairs (RR, GG, BB) and convert each pair from hexadecimal to decimal. For example, #FF5733: FF=255, 57=87, 33=51 → rgb(255, 87, 51).
What is the difference between HEX and RGB?
They represent the same colors differently. HEX uses a compact hexadecimal notation (#FF0000). RGB uses decimal values for each channel (rgb(255, 0, 0)). Both produce identical results in CSS.
Can I include transparency with HEX?
Yes, using 8-digit hex (#RRGGBBAA) where the last two digits are the alpha channel. However, rgba() syntax is more commonly used for transparency: rgba(255, 0, 0, 0.5).

Related Color Conversions