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.
Last updated:
How to read HEX, RGB and HSL
- HEX (#RRGGBB) writes red, green and blue as two hexadecimal digits each, 00–FF. It is the most common format in CSS and design tools.
- RGB writes the same three channels in decimal, 0–255: rgb(139, 92, 246).
- HSL describes hue (0–360° around the color wheel), saturation (0–100%) and lightness (0–100%). It is the easiest format to tweak by hand: raise lightness for a tint, lower it for a shade.
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.