Color Picker & Converter
Pick a color or paste any code — get HEX, RGB, HSL, HSV and CMYK instantly, with one-click copy. Everything stays in your browser.
Not a valid color — keeping the previous one.
Screen eyedropper works in Chrome and Edge.
Five notations, one color
Every color a screen or printer produces can be written in more than one way, and none of the notations is more "correct" than another — they're just different coordinate systems for the same point in color space. HEX and RGB describe how a monitor mixes red, green and blue light (additive color: stack all three at full strength and you get white). HSL and HSV re-describe that same light using hue, saturation and either lightness or value/brightness, which maps much closer to how people actually think about color ("a darker version of this blue"). CMYK flips the model entirely: it describes ink absorbing light off paper (subtractive color), so a designer preparing artwork for offset or digital print needs numbers in that space, not RGB.
Knowing which notation to reach for — and how to convert between them by hand — matters whenever a design tool, a CSS file, a print house and a client screenshot each hand you the same color in a different format.
HEX — compact hexadecimal for CSS
#RRGGBB packs the red, green and blue channels into two hexadecimal digits each (base 16, digits 0–9 and A–F), so every channel runs from 00 (0) to FF (255). An optional fourth pair, #RRGGBBAA, adds alpha (transparency) the same way. It's the format CSS, design tools and version-controlled style sheets use by default because it's short, copy-pastable and unambiguous.
RGB(A) — the channels a screen actually lights up
rgb(r, g, b) writes the same three channels in plain decimal, 0–255 each, with an optional fourth alpha value from 0 (fully transparent) to 1 (fully opaque) in rgba(). This is the literal voltage sent to a pixel's red, green and blue sub-elements, which is why image-processing code and canvas APIs work in RGB rather than hex strings.
HSL vs. HSV/HSB — the same wheel, two different third axes
Both start from hue, the angle around a color wheel from 0° to 360° (0/360 = red, 120 = green, 240 = blue), and saturation, how far the color sits from gray. They diverge on the third axis. HSL's lightness runs 0% (always black) to 100% (always white, regardless of hue), with pure, fully-saturated color sitting at 50% lightness. HSV/HSB's value (or "brightness") instead runs 0% (black) to 100% (the brightest, most vivid version of that hue) — at 100% value a fully saturated color stays fully saturated, it never fades toward white the way HSL does. That difference is exactly why most design-app color pickers use HSV (drag a big square for saturation × value, then pick a hue) while CSS gradients and "make it 20% lighter" tweaks read more naturally in HSL.
CMYK — subtractive ink for print
Cyan, Magenta, Yellow and Key (black), each 0–100%, describe how much of each ink a printer lays down. Light bounces off white paper and each ink layer absorbs (subtracts) part of the spectrum before it reaches your eye, which is the opposite process from a screen's additive RGB. Black ink (K) exists mainly because mixing 100% cyan+magenta+yellow gives a muddy dark brown rather than true black, and using pure black ink for text and shadows is both cheaper and sharper than three overlapping color inks.
How the math converts one into another
Every conversion starts by normalizing R, G, B from 0–255 to a 0–1 fraction (r′, g′, b′). From there:
- To HSL: lightness L = (max + min) ÷ 2 of the three fractions. Saturation is the spread (max − min) rescaled against how close L already is to black or white. Hue comes from which channel is largest and how far the other two lag behind it, mapped onto the 360° wheel.
- To HSV: value V = max of r′, g′, b′ directly. Saturation is (max − min) ÷ max — a much simpler ratio than HSL's, which is part of why HSV is easier to build a slider UI around. Hue uses the same formula as HSL.
- To CMYK: black K = 1 − max(r′, g′, b′). Then each ink channel is (1 − channel′ − K) ÷ (1 − K), which effectively "factors out" the shared darkness into K before computing the pure color underneath.
Worked examples
#D946EF.R=217, G=70, B=239 → fractions 0.8510, 0.2745, 0.9373. Max is blue (0.9373), min is green (0.2745).
HSL: L = (0.9373+0.2745)/2 = 0.606 → 61%; S works out to 84%; hue lands at 292° →
hsl(292, 84%, 61%).HSV: V = 0.9373 → 94%; S = (0.9373−0.2745)/0.9373 = 71%; same hue, 292° →
hsv(292°, 71%, 94%).CMYK: K = 1−0.9373 = 6%; C ≈ 9%; M ≈ 71%; Y = 0% (blue is the max channel, so yellow — blue's ink complement — drops to zero) →
cmyk(9%, 71%, 0%, 6%).
#FF0000.R=255, G=0, B=0. HSL comes out to a clean
hsl(0, 100%, 50%) — 50% lightness is the textbook midpoint for any fully saturated hue. HSV is hsv(0°, 100%, 100%) — value sits at the top because red itself is the brightest state of that hue, unlike HSL's lightness. CMYK works out to cmyk(0%, 100%, 100%, 0%) — no black ink needed, full magenta and yellow, since red is what's left when you remove cyan (red's ink complement) entirely.
#4682B4 ("steel blue").R=70, G=130, B=180 → fractions 0.2745, 0.5098, 0.7059. This one shows what a desaturated color looks like across formats:
hsl(207°, 44%, 49%), hsv(207°, 61%, 71%), and cmyk(61%, 28%, 0%, 29%). Notice HSL's saturation (44%) and HSV's saturation (61%) disagree even though it's the exact same color — they're measuring "distance from gray" against a different reference axis (lightness vs. value), which is a common point of confusion when comparing values copied from two different apps.
Format quick-reference
| Format | Example | Channel ranges | Typically used for |
|---|---|---|---|
| HEX | #D946EF | 00–FF per channel (base 16) | CSS, design-tool swatches, hand-edited style sheets |
| RGB(A) | rgb(217, 70, 239) | 0–255 per channel, alpha 0–1 | Canvas/JS pixel math, image processing |
| HSL(A) | hsl(292, 84%, 61%) | hue 0–360°, sat/light 0–100% | CSS theming — lighten/darken/desaturate a hue predictably |
| HSV/HSB | hsv(292°, 71%, 94%) | hue 0–360°, sat/value 0–100% | Design-app color pickers (saturation × value square) |
| CMYK | cmyk(9%, 71%, 0%, 6%) | 0–100% per ink | Offset/digital print production |
Common mistakes
- Reading a screen's CMYK as press-ready. Any on-screen CMYK figure — including this tool's — is computed with a simple formula, not a specific press or paper ICC profile. It's a useful ballpark, but a print shop's calibrated separation can shift the actual ink percentages noticeably.
- Treating HSL lightness and HSV value as interchangeable. 100% lightness is always white no matter the hue; 100% value can still be a fully saturated, vivid color. Dragging a "lightness" slider to max and a "value" slider to max do very different things.
- Assuming 3-digit hex shorthand always exists.
#fffonly works when both digits of every channel repeat (#RRGGBB→#RGB); a color like#D946EFhas no shorter form. - Forgetting alpha isn't part of hue/saturation/lightness math. Opacity is a separate compositing step layered on top of any of these five models — converting formats doesn't change how transparent something looks.
What this tool doesn't cover
All the math above assumes the sRGB color space, the default that web browsers and CSS use. Wide-gamut spaces such as Display P3 or Adobe RGB can represent some colors — deeply saturated reds and greens especially — that sRGB simply can't reach, so a P3 swatch sampled from a modern photo may shift slightly once expressed as sRGB hex or RGB. This tool also doesn't perform perceptual color-difference (ΔE) calculations or color-blindness simulation; its accessibility check is limited to the WCAG contrast ratio described in the FAQ below.
Sources & further reading
Frequently asked questions
HEX, RGB, HSL, HSV and CMYK — what does each color format mean?
They are five ways to write the same color. HEX (#RRGGBB) is the compact hexadecimal notation CSS and design tools use most; this color converter turns any HEX to RGB and back. RGB(A) gives the red, green and blue channels as 0–255 (plus an optional alpha for transparency) and is how screens actually mix light. HSL and HSV both describe a color by its hue (the angle on the color wheel), saturation and either lightness (HSL) or value/brightness (HSV) — far more intuitive when you want a lighter or more muted variant. CMYK (cyan, magenta, yellow, black as percentages) is the subtractive model for print. Pick a color once and this tool shows every format at the same time, each with its own copy button.
How do I pick a color from anywhere on my screen?
Click “Pick from screen” and a magnifier appears — hover over any pixel, anywhere on your display (a photo, another app, a website), and click to grab its exact color. It uses the browser’s built-in EyeDropper API, so the button only shows up where that is supported: today that means Chromium browsers such as Chrome, Edge, Opera and Brave on desktop. Firefox and Safari do not expose the API yet, so the button is hidden there and you can still type or paste any color code instead. Nothing about the screen is uploaded — the sampling happens locally in the browser.
What is 8-digit hex and the alpha channel?
Alpha is the opacity of a color: 1 (or 100%) is fully solid and 0 is fully transparent. A normal 6-digit hex like #d946ef has no alpha, so to store transparency CSS added 8-digit hex — #RRGGBBAA — where the last two digits are the alpha as hex (for example #d946ef80 is about 50% opaque). This picker has an opacity slider; the moment you drop below 100% it adds the 8-digit hex and the rgba()/hsla() rows so you can copy whichever your CSS needs, and the preview shows the checkerboard through the transparent color.
What does the WCAG AA / AAA contrast badge tell me?
It measures how legible text would be on the color you picked. The tool computes the WCAG contrast ratio (from 1:1 up to 21:1) for both black and white text and marks the more readable one as “Best”. As a rule of thumb, normal body text needs a ratio of at least 4.5:1 to pass WCAG AA and 7:1 to reach the stricter AAA, while large or bold text can pass AA at 3:1. If both black and white read “Fail”, the color is a poor background for text and you should darken or lighten it. This lets designers check accessibility while they choose a color, not afterward.
Is my color data sent anywhere?
No. Every conversion — HEX to RGB, RGB to HEX, HSL, HSV, CMYK, the contrast check and the eyedropper — runs entirely in your browser with plain JavaScript. Nothing is uploaded, logged or shared, so it is safe to use with brand or client colors. Your last color is remembered only in your own browser’s local storage so the tool reopens where you left off, and the page URL also carries the color so you can bookmark or share an exact shade.