HTML Color Picker

Drag hue, saturation and lightness, or paste any CSS color string you already have. Six formats update together, and the WCAG contrast ratio against white and black stays on screen the whole time you are choosing.

Color picking workspace

Pick a color, read every format
  • Runs offline after load
  • Contrast against #FFF and #000
  • The color rides in the URL
#0D47FBnearest royalblue
228°
96%
52%
1.00
Hex#0D47FB
Hex8#0D47FBFF
RGBrgb(13, 71, 251)
RGBArgba(13, 71, 251, 1)
HSLhsl(228, 96%, 52%)
HSVhsv(225, 95%, 98%)
CMYKcmyk(95%, 72%, 0%, 2%)
Name~ royalblue

Text contrast

AA needs 4.5:1, AAA needs 7:1
White text6.34:1
Black text3.31:1

Hue relatives

Click one to make it the picked color

Lightness row

5% to 95% at the same hue

Recent

Stored on this device only

A hex code tells you the color and nothing about whether text on top of it stays readable

Copying #0D47FB out of a design file takes two seconds. Finding out three sprints later the white label sitting on top of it misses 4.5:1 by a hair takes rather longer. Most pickers hand back a hex string and stop there. This page keeps the contrast ratio against white and black on screen while you drag, so the color and its readability arrive at the same moment.

The split happens because of tooling. Design software reports color in HSB, stylesheets ship hex, print work runs on CMYK, and an accessibility audit asks for a ratio nobody has seen until the audit lands. One color, five numbers, five different windows. Everything below sits in one panel.

One color, eight ways of writing it

FormatExampleWhere you meet it
#4169E1Six hex digitsStylesheets, design handoff, brand guidelines
#4169E1CCHex plus an alpha byteCSS Color 4 syntax, ignored by browsers older than 2016
rgb(65, 105, 225)Three channels, 0 to 255Canvas, SVG attributes, most image libraries
rgba(65, 105, 225, 0.8)Alpha as a decimalOverlays, shadows, hover states
hsl(225, 73%, 57%)Hue in degreesDesign tokens and any color edited by hand
hsv(225, 71%, 88%)Hue, saturation, valueThe HSB readout in Figma, Sketch and Photoshop
cmyk(71%, 53%, 0%, 12%)Four ink percentagesPrint layout, as a rough screen estimate
royalblueA CSS keywordOne of the 148 names browsers recognise

The sliders run on HSL because hex resists editing

Hex is three bytes of storage. Ask for a blue ten percent lighter and hex has no answer, because lightness is not one of the things a hex triplet stores. HSL splits the same color into hue, saturation and lightness, so each slider moves one property while the other two hold still. Drag lightness from 52 to 62 and the hue stays where you left it.

Why the hue slider still responds on black

At lightness 0, and again at saturation 0, every hue collapses to the same RGB triplet. A picker reading hue back out of the swatch loses your angle at both ends and snaps to red on the way back.

This page treats H, S and L as the stored values and derives RGB from them, never the reverse. Slide lightness down to black, then back up, and the hue you picked is still there.

Contrast sits beside the swatch, not on a second page

Both tiles show your color as a background with real text on top, one white and one black. The ratio below each comes from the WCAG 2.1 relative luminance formula, the same math an audit tool runs. Three badges follow it: AA at 4.5:1 for body text, AAA at 7:1, and AA large at 3:1 for text from 24px, or 18.66px when bold.

Two limits are worth knowing before you rely on the number. Alpha is left out of the calculation, because the real contrast of a translucent color depends on the layer underneath, which this page cannot see. Anti aliased edges on thin type also read lighter than the ratio suggests, so a color scraping past 4.5:1 with a hairline font is worth testing on a real screen.

Six shapes of input are accepted

  1. Hex in any length. Three, four, six or eight digits, with or without the leading hash. #e14, e14f and #EE1144FF all land on the same place.
  2. rgb() and rgba(). Comma separated or space separated, with alpha written as a decimal or a percentage.
  3. hsl() and hsla(). The deg suffix and the percent signs are optional, so a value copied out of a stylesheet pastes straight in.
  4. A CSS keyword.tomato, rebeccapurple, slategray. British spellings such as grey and dimgrey resolve to the same values.
  5. The system dialog. The small square opens your operating system picker, including the gradient area some designers prefer over sliders.
  6. The screen itself. The eyedropper button appears in Chrome, Edge and Opera, where the browser exposes the EyeDropper API. Firefox and Safari hide the button rather than showing one that fails.

Hue relatives are a starting point, never a finished palette

The six chips rotate the hue wheel by fixed angles: 180 degrees for the complement, 30 either side for analogous neighbours, 120 and 240 for a triad, 90 for a square. Saturation and lightness are held steady so the group reads as a set.

Equal steps on that wheel are not equal steps in how bright a color looks. Yellow at 50 percent lightness reads far brighter than blue at 50 percent lightness, because human vision weights green around six times heavier than blue. Take each chip through the contrast tiles before it goes near body text.

The color travels in the URL

The address bar updates as you drag. Bookmark the page mid pick, paste the link into a ticket, send it to whoever asked for the shade. Opening the link puts the exact color back on screen. The fragment after the hash is never sent to a server by any browser, so the link stays between you and the person you sent it to.

Recent colors are held in localStorage on your own machine. Clearing site data clears them. Nothing about your picks reaches the network, before or after the page finishes loading.

Where this picker stops

Questions people ask while picking a color

Formats, contrast math, alpha, and what a browser based picker refuses to guess at.

Which format should go into my stylesheet?

Hex for a fixed brand color, since every tool in the chain reads it and nobody misreads a six digit string. HSL for anything you plan to adjust later, because a hover state built as the same hue five percent darker survives a brand change that a second hex value would not. RGBA when the color needs transparency and you want the alpha readable at a glance. All four appear in the format row, so the choice costs one click either way.

Why does the contrast ratio not change when I move the alpha slider?

WCAG contrast is calculated between two solid colors. A translucent color has no single luminance until you know what sits behind it, and a browser page has no way to inspect the background of the design you are building. The ratio shown is for the color at full opacity. When you need the real figure for a translucent overlay, blend it against the actual backdrop first, then paste the blended hex back into this page.

What is the difference between HSL and HSV?

Both start with the same hue angle. HSL puts pure white at lightness 100 and pure black at lightness 0, with the fully saturated color sitting at 50. HSV puts the fully saturated color at value 100 and reaches white only when saturation drops to zero as well. Design software labels HSV as HSB, so the numbers in Figma match the HSV line here rather than the HSL line, which trips people up constantly.

Can I trust the CMYK numbers for print?

Treat them as a rough starting point. The conversion here is the standard arithmetic formula with no color profile attached, so it knows nothing about the ink set, the paper or the press. Vivid screen colors in particular sit outside what four process inks reproduce, and a bright cyan on screen prints noticeably flatter. Send artwork to a printer and ask for a proof before a run.

Why does the eyedropper button not appear for me?

The button only shows when the browser exposes the EyeDropper API, which today means Chrome, Edge and Opera on desktop. Firefox and Safari have not shipped it, so the button stays hidden rather than appearing and failing. Firefox users have a built in eyedropper under the developer tools menu, and macOS ships Digital Color Meter, both of which give you a hex to paste into the text field.

Is my color sent anywhere?

No. Every conversion, the contrast math and the name matching all run in your browser. The page makes no network request after it loads, and you are welcome to prove that by cutting your connection and carrying on. The color in the address bar sits after the hash, a part of the URL browsers never transmit, and the recent row lives in localStorage on your own device.

Why does the color name have a tilde in front of it?

A tilde means your color is close to a CSS keyword without matching one exactly. The 148 named colors are scattered points, so most of the sixteen million sRGB values have no exact name. Matching uses a weighted RGB distance that ranks differences roughly the way eyes do. When you land precisely on a keyword the tilde disappears and the plain name is shown instead.

How do I get a lighter or darker version of the same color?

Use the lightness row under the panel. It holds your hue and saturation and steps lightness from 5 percent to 95 percent in nine point jumps, and clicking any square makes it the picked color. This beats nudging a hex by hand, which drifts hue as soon as one channel clips at 255. Check the result against the contrast tiles, since a step lighter often moves a color from passing AA to failing it.

Does 4.5:1 apply to every piece of text?

No. WCAG 2.1 AA asks for 4.5:1 on body text and drops to 3:1 for large text, meaning 24px and up, or 18.66px and up when bold. AAA raises those to 7:1 and 4.5:1. User interface components and graphical objects have their own 3:1 requirement under 1.4.11. All three thresholds appear as badges under each ratio so you are not converting in your head.

What happens to my hex if I round trip it through the sliders?

It may shift by a digit or two. Hue, saturation and lightness are reported as whole numbers, and rounding those before converting back to RGB loses a fraction of a channel. The shift is invisible on screen and irrelevant for most work, though it matters when a brand hex has to match a printed spec character for character. Copy the hex value before you touch the sliders in that case.