HEX to RGB Converter

Convert between HEX, RGB, and HSL color formats instantly

#2563EB
#
or enter RGB
HEX
#2563EB
Copied!
RGB
rgb(37, 99, 235)
Copied!
HSL
hsl(221, 83%, 53%)
Copied!
CSS RGB
37, 99, 235
Copied!

Frequently Asked Questions

What is the difference between HEX and RGB color codes? +
HEX and RGB both represent colors using red, green, and blue components. HEX uses a six-character hexadecimal string (e.g. #FF5733), while RGB uses three decimal numbers from 0-255 (e.g. rgb(255, 87, 51)). They represent the same colors, just in different formats.
What is a 3-digit HEX code? +
A 3-digit HEX code is shorthand where each digit is doubled to form the full 6-digit code. For example, #F80 expands to #FF8800. It only works when each pair of digits in the full code is the same character (FF, 88, 00).
What is HSL and how does it differ from RGB? +
HSL stands for Hue, Saturation, and Lightness. Hue is the color angle (0-360 degrees), Saturation is the color intensity (0-100%), and Lightness is how light or dark the color is (0-100%). HSL is often more intuitive for humans to work with than RGB because adjusting brightness or vividness is straightforward.
Do I need the # symbol in HEX codes? +
In CSS, the # symbol is required before a HEX color code. This converter accepts input with or without the # symbol and will work either way. The output always includes the # for proper CSS usage.
Can I convert RGB back to HEX? +
Yes. This tool supports bidirectional conversion. Enter RGB values (0-255 for each of red, green, and blue) and the corresponding HEX code will be shown instantly. The conversion works in both directions as you type.