Color Picker
Free Online HEX, RGB & HSL Color Converter
Pick any color or type a value in HEX, RGB, or HSL format. The tool converts it instantly across all three formats and generates a palette of shades and tints.
Shades & Tints
Click any swatch to copy its HEX value to your clipboard.
How to Use the Color Picker
1. Pick a Color
Use the color swatch input to choose any color from the picker, or drag your cursor to fine-tune the hue.
2. Enter Any Format
Type a HEX, RGB, or HSL value into any field. The other two formats update automatically in real time.
3. Copy the Codes
Click a shade or tint swatch to copy its HEX code, or select and copy the value from any field for use in your CSS, design, or code.
What are HEX, RGB, and HSL?
Colors on the web are commonly expressed in three formats. HEX is a six-digit hexadecimal code such as #3B82F6. RGB defines a color by its red, green, and blue channels, each ranging from 0 to 255. HSL describes a color by hue, saturation, and lightness, which is often more intuitive for designers adjusting brightness or saturation.
Our tool converts between all three formats in real time using the standard color conversion formulas, so you can grab the exact code you need without manual math.
One Colour, Three Notations
Take the blue #3B82F6. The HEX code is just three bytes written in base 16: 3B = 59 red, 82 = 130 green, F6 = 246 blue. That gives rgb(59, 130, 246).
HSL describes the same colour in terms people think in. Divide each channel by 255, find the largest (blue, 0.965) and smallest (red, 0.231). Lightness is their average, 0.598, so about 60%. Saturation is how far apart they are relative to how much room there was: 0.733 ÷ (1 − |2 × 0.598 − 1|) ≈ 91%. Hue is an angle on the colour wheel worked out from which channel dominates; with blue on top it lands at about 217°. Result: hsl(217, 91%, 60%).
Type any of the three into the tool and the other two update, using exactly these formulas.
Which Format to Use Where
- HEX is the most compact and what design tools like Figma show by default. Good for sharing a brand colour in a message.
- RGB maps directly to screen pixels and to code that handles channels separately, for example image processing or canvas drawing.
- HSL is the most useful while designing. To make a hover state, keep hue and saturation and lower lightness by 8–10 points. To make a disabled state, lower saturation. Doing that in HEX means guessing.
All three are interchangeable in CSS. Modern browsers also accept an alpha value, e.g. rgb(59 130 246 / 50%), for transparency.
How the Shades and Tints Row Is Made
The five swatches keep your colour's hue and saturation and set lightness to 85%, 70%, 55%, 40% and 25%. That produces a light background tint, two mid tones and two deep shades that clearly belong to the same family. A typical use:
- Pick your brand colour.
- Use the 85% swatch as a background for highlighted panels or alerts.
- Use the 40% or 25% swatch for text placed on that background.
- Click a swatch to copy its HEX code straight into your stylesheet.
Because HSL lightness is a mathematical average rather than perceived brightness, a yellow and a blue at the same 55% lightness do not look equally bright. Always check text contrast, described next.
Contrast: the Check Designers Forget
WCAG 2.1, the web accessibility guideline, asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (about 24 px, or 19 px bold). The ratio compares the relative luminance of the two colours. Real numbers for white text on three blues:
| Background | Contrast with white | Normal text |
|---|---|---|
#3B82F6 | 3.68 : 1 | Fails; fine for large headings only |
#2563EB | 5.17 : 1 | Passes |
#1D4ED8 | 6.70 : 1 | Passes comfortably |
A button that "looks fine" on your monitor may be unreadable for someone with low vision or on a phone in sunlight. If your colour fails, take one of the darker swatches from the row above.
Common Problems
- The colour looks different in print. Screens mix light (RGB); printers mix ink (CMYK). Bright blues and greens often can't be printed exactly. Ask your printer for a proof.
- Three-digit HEX.
#3BFis shorthand for#33BBFF, each digit doubled, not#3B0F00. - Values out of range. RGB channels run 0–255, hue 0–360, saturation and lightness 0–100%. Anything else is rejected.
- Sampling a colour from a screenshot. Compression can shift colours by a few values. Get the exact code from the source file or style guide when it matters.
Generating a QR code in your brand colour? Pick a dark shade here and use it in the QR Code Generator, keeping strong contrast with the background. More in developer tools.
Frequently Asked Questions
How do I convert HEX to RGB?
Split the six digits into three pairs and convert each from base 16 to decimal. #3B82F6 becomes 59, 130, 246. Or type it into the HEX field above.
What is the difference between HSL and HSB?
Both use hue and saturation, but HSL's lightness runs from black through the pure colour to white, while HSB's brightness runs from black to the pure colour. The same colour has different numbers in each.
How are the shades and tints generated?
The tool keeps your colour's hue and saturation and sets lightness to 85, 70, 55, 40 and 25 percent.
What contrast ratio does text need?
WCAG 2.1 level AA requires at least 4.5 to 1 for normal text and 3 to 1 for large text.