HEX to RGB Color Converter

Convert HEX color codes to RGB, HSL, and CSS values instantly. Also convert RGB back to HEX.

#2563EB
#
RGBrgb(37, 99, 235)
HSLhsl(220, 83%, 53%)
CSScolor: #2563EB;
R G BR:37 G:99 B:235
HEX#2563EB

Click a color to load it:

How to Convert HEX to RGB

A HEX color code is a 6-digit hexadecimal number representing a color, written as #RRGGBB. To convert to RGB, split the code into three 2-digit pairs and convert each from base-16 to base-10. For example, #FF5733 splits into FF (red), 57 (green), 33 (blue). In decimal: FF=255, 57=87, 33=51. Result: rgb(255, 87, 51). This tool does the conversion automatically — just type or paste any HEX code.

HEX vs RGB — What Is the Difference?

HEX and RGB represent the same colours using different notation. RGB lists three decimal numbers (0-255) for red, green, and blue. HEX encodes those same three numbers in base-16 notation as a 6-character string prefixed with #. Both are equally valid in CSS — color: rgb(255, 99, 71) and color: #FF6347 render identically. HEX is more compact for typing; RGB is more readable for understanding the colour values.

Common HEX Color Codes

#FFFFFF = white | #000000 = black | #FF0000 = pure red | #00FF00 = pure green | #0000FF = pure blue | #FFFF00 = yellow | #FF6347 = tomato red | #40E0D0 = turquoise | #FFD700 = gold. The first two characters represent red intensity (00=none, FF=max), the middle two represent green, and the last two represent blue.

Frequently Asked Questions

Split the 6-digit HEX into pairs (RR, GG, BB) and convert each from hex to decimal. #FF5733 → R:255, G:87, B:51 → rgb(255, 87, 51).
Both represent the same colours differently. RGB uses decimals (0-255). HEX uses base-16 notation (#RRGGBB). Identical in CSS — #FF0000 and rgb(255,0,0) are both pure red.
#FFFFFF is pure white. FF hex = 255 decimal. So #FFFFFF = rgb(255,255,255) — max red + max green + max blue = white. #000000 = black (rgb(0,0,0)).
Copied!