Color Picker and Converter with a WCAG Contrast Checker

Type or paste any color value and see it as HEX, RGB, HSL and HSV at once. Copy the one your codebase needs, then check the pair you are about to ship against the WCAG contrast thresholds.

Color picker

Computed in this tab — nothing sent anywhere

Color Any notation

Paste any of these forms: #0b7d74, #0b7d74cc, rgb(11 125 116), rgba(11, 125, 116, 0.8), hsl(174 84% 27%).

Presets Click to load
Hue, saturation, lightness HSL
174°
84%
27%
#0B7D74
Values Copy any of them
HEX #0B7D74
RGB rgb(11, 125, 116)
HSL hsl(174, 84%, 27%)
HSV h 173° · s 91% · v 49%

CSS has no hsv() function — HSV is the model color pickers are built on, so use it for a picker's own state, not in a stylesheet.

Contrast check This color on a background

—

AA AAA AA large AAA large
Sample text on this color

Tints and shades Click one to use it

All four notations describe the same pixels. What changes is only how the value is written, so switching format never changes your color.

Contrast is calculated on opaque colors. If a value has an alpha channel, the ratio is computed as if it were fully opaque.

Nothing here is uploaded or saved. No account, no history, no palette in the cloud.

Why the same color has four notations

A color is not a number; it is a set of three intensities that a display mixes. HEX, RGB, HSL and HSV are four ways of writing those same three numbers, and each one is convenient for a different job. CSS authors type hex because it is short. Design tools show HSL because it is easier to nudge a hue. Color pickers are built on HSV because that is the space where dragging a point feels like picking a color. Print people live in percentages.

The practical consequence: converting between them is lossless. A hex value and its RGB form are the same instruction to the screen. If a conversion tool shows a slightly different color after a round trip, it is rounding somewhere, not doing anything useful.

What each notation actually means

HEX is RGB written in base 16. The short form #f00 expands to #ff0000 — each digit is doubled. Four- and eight-digit forms add an alpha channel (#f008 is red with half opacity), which is why pasting a 4-digit hex into a tool that only accepts 6 digits produces a wrong color rather than an error.

RGB writes the three channels as integers from 0 to 255, or as percentages. Both are valid CSS, and they are not interchangeable digit for digit: rgb(50%) is 127.5, which browsers round to 128, not 127. That half-pixel difference is exactly where hand-written converters go wrong.

HSL is hue in degrees (0–360), saturation and lightness in percent. It is the format to reach for when you want to keep a hue and change how light the color is, because lightness moves independently.

HSV (also called HSB) uses the same hue, but the other two axes are saturation and value. HSV describes a color as a pure hue with white or black mixed in, which is why pickers use it: the top-right corner of the box is the pure hue, the bottom is black.

FormatExampleBest for
HEX#1b7f79CSS, design handoff, short values
RGBrgb(27 127 121)Channels you need to compute with
HSLhsl(176 65% 29%)Keeping a hue while changing lightness
HSVhsv(176 79% 50%)Picker geometry, quick "same hue, different brightness" work
Advertisement

Contrast is the part that gets products rejected

WCAG defines contrast as a ratio between two relative luminances, from 1:1 (identical) to 21:1 (black on white). The formula weights the green channel most heavily, because human vision is most sensitive to it:

(L1 + 0.05) / (L2 + 0.05), where L is relative luminance after each channel is linearized out of sRGB.

The thresholds worth memorizing:

  • 4.5:1 — normal body text, AA.
  • 3:1 — large text (about 18pt, or 14pt bold) at AA, and also the minimum for UI components and graphical objects.
  • 7:1 — normal text at AAA.
  • 4.5:1 — large text at AAA.

Two traps that catch people after the checker says pass. First, the ratio is computed on the colors as written, not on what the browser actually renders: a semi-transparent text color over a background is mathematically a different color, so the safe move is to flatten the alpha yourself and check the result. Second, passing AA on a color pair does not mean the layout passes — text over a gradient or an image is a contrast problem that a single pair cannot express.

Advertisement

Tints, shades and why you want a ramp, not one color

A tint is the color mixed with white; a shade is the color mixed with black. Nine evenly spaced steps from a light tint to a dark shade give you the set most design systems use for hover, active, disabled and border states. Working from a ramp rather than inventing values keeps a UI coherent: the button, its hover state and its focus ring are recognizably the same color at different weights.

One caution: mixing in sRGB is not the same as mixing in a perceptual space, so a 50% tint of a saturated blue looks brighter than you might expect. That is fine for UI states as long as you judge the result visually rather than trusting the arithmetic.

Getting the value out without breaking it

Copy the format the destination expects. Three failure modes account for most broken pastes:

  • Alpha dropped. Going from #1b7f7980 to a six-digit hex silently makes the color opaque.
  • Percentages read as integers. rgb(27% 50% 47%) is not rgb(27 50 47) — the first is a muted teal, the second is a dark one.
  • Hue without its unit. HSL hue is degrees; a bare number in some tools is radians or a 0–1 fraction.

Nothing leaves the page

Every conversion and every contrast calculation runs in JavaScript against values in the form. There is no upload, no account, no saved palette, and no request carrying the colors you are working on — which matters when a color pair encodes an unreleased brand system. Verify it in the network panel: changing a value produces no outbound request.

Check before you commit the value

Three things, in order: paste the value into the real stylesheet and look at it on the actual background; check the contrast of the final pair, not the pair you designed in isolation; and keep the notation consistent across the codebase, because a mix of hex and rgba for the same token is how a design system drifts.

Back to all SizeGlide tools.

Frequently asked questions

Why do HEX and RGB show the same color?

They are the same three channel values written differently: hex is base 16, RGB is base 10. Converting one to the other changes nothing on screen, and a tool that shows a different color after a round trip is rounding somewhere.

What is the difference between HSL and HSV?

Both use hue, but HSL's other axes are saturation and lightness, while HSV's are saturation and value. HSV is the space pickers are built on because its geometry matches a color box; HSL is what CSS exposes. A pure hue in HSL sits at 50% lightness, in HSV at 100% value.

What contrast ratio do I need?

4.5:1 for normal body text at AA, 3:1 for large text at AA, 7:1 for normal text at AAA, and 3:1 as the minimum for UI components and graphical objects. The same pair can pass for a heading and fail for a paragraph, so check the size you will actually use.

Does the contrast check use transparency?

No. The ratio assumes both colors are opaque, which is how WCAG defines contrast. If your text color has an alpha channel, flatten it against the real background first and check the resulting solid color.

Is anything uploaded or saved?

No. Conversion and contrast calculations run in your browser, and no palette, history or account is stored. Reloading the page clears the values, so copy what you need before you leave.

Advertisement