HEX to RGB Converter

Convert HEX color codes to RGB and HSL instantly. Supports 3, 4, 6 and 8-digit hex with alpha, a color picker and copy-ready CSS values. Free and private.

#
All formats
HEX#5B2B82
RGBrgb(91, 43, 130)
HSLhsl(273, 50%, 34%)

Runs locally in your browser. Nothing you enter is uploaded.

How to convert HEX to RGB

  1. Type or paste a hex code such as #5B2B82 — or use the color picker.
  2. The RGB, HEX and HSL values update instantly, with a live preview.
  3. Click Copy next to the format you need.

How HEX colors work

A hex color is three pairs of hexadecimal digits for red, green and blue, each from 00 (0) to FF (255).

HEX RGB Color
#000000 rgb(0, 0, 0) Black
#FFFFFF rgb(255, 255, 255) White
#FF0000 rgb(255, 0, 0) Red
#5B2B82 rgb(91, 43, 130) Figtray plum

Why convert to RGB?

Frequently asked questions

How do I convert HEX to RGB manually?

Split the six digits into three pairs and convert each from hexadecimal to decimal. #5B2B82 → 5B = 91, 2B = 43, 82 = 130, so rgb(91, 43, 130).

What do 3-digit and 8-digit hex codes mean?

#RGB is shorthand where each digit is doubled (#F80 = #FF8800). An 8-digit code #RRGGBBAA adds an alpha (opacity) channel; #FF000080 is red at about 50% opacity.

Do I need the # symbol?

No. 5B2B82 and #5B2B82 both work, in upper or lower case.

More Color tools →