My Color Palette Generator

HEX Color Picker

Pick a color or type a HEX code to get its RGB and HSL values, copy any format, and see whether white or black text is readable on it.

#8B5CF6
HEX
RGB
HSL
Contrast with white text
Contrast with black text

Last updated:

How to read HEX, RGB and HSL

The contrast lines show the WCAG ratio of white and black text on your color; 4.5:1 or more passes AA for normal text. Need to convert a code you already have? Use the HEX to RGB converter.

Frequently asked questions

What is a HEX color code?

A HEX color code is # followed by six hexadecimal digits: two each for red, green and blue. Each pair runs from 00 to FF, which is 0 to 255 in decimal, so #000000 is black, #FFFFFF is white and #FF0000 is pure red.

How do I convert the HEX code to RGB?

Split the code into three pairs and convert each pair from base 16 to base 10. #8B5CF6 becomes 8B = 139, 5C = 92 and F6 = 246, so rgb(139, 92, 246). The picker shows RGB and HSL automatically, and the HEX to RGB converter explains the formula.

Can I type a 3-digit HEX code?

Yes. Shorthand codes are expanded by doubling each digit, so #F53 becomes #FF5533. Eight-digit codes (#RRGGBBAA) are accepted too; the last pair is transparency and is ignored for the solid color.

Related tools