HEX to RGB converter

Paste a hex code such as #1e90ff to get rgb(30, 144, 255) and every other format.

HEX
RGB
HSL
HSV
CMYK
LAB

HEX to RGB formula

R = hex[0..1] in base 16 · G = hex[2..3] · B = hex[4..5]

For a pair like 9F: 9 × 16 + 15 = 159. Three-digit codes double each digit: #3c9 = #33cc99.

Common hex codes

HEXRGBName
#ffffff255, 255, 255white
#0000000, 0, 0black
#ff0000255, 0, 0red
#00ff000, 255, 0lime
#0000ff0, 0, 255blue
#ffff00255, 255, 0yellow
#00ffff0, 255, 255cyan
#ff00ff255, 0, 255magenta
#808080128, 128, 128gray
#ffa500255, 165, 0orange
#800080128, 0, 128purple
#a52a2a165, 42, 42brown

Frequently asked questions

What does each pair in a hex code mean?
Red, green and blue intensity from 00 (none) to FF (full, 255).
What about 8-digit hex?
The last two digits are alpha (opacity). The converter ignores them and converts the color part.