Color picker

Drag in the square or pick a color from your screen, then copy its HEX, RGB or HSL code. You can also type or paste a code, set opacity, and see whether white or black text reads better on it.

Drag in the square, or focus it and use the arrow keys: left and right change saturation, up and down change brightness. Hold Shift for steps of 10.

Want a color from a photo? Open it in the image color picker.

Color codes

Nearest CSS color name

Text on this color

How to use the color picker

  1. Drag the round handle in the square: left to right adds saturation, bottom to top adds brightness. With the keyboard, focus the square and use the arrow keys (Shift for steps of 10).
  2. Move the Hue slider to change the base color, and the Opacity (alpha) slider to make it see-through.
  3. Or type or paste any color into Type or paste a color, such as #ff8800, rgb(0 128 128), hsl(200, 80%, 45%), oklch(70% 0.15 150) or rebeccapurple.
  4. In Chrome or Edge on a computer, click Pick from screen and then click any pixel on your screen to take its color.
  5. Copy the HEX, RGB, HSL, HSV, OKLCH or CMYK code from the Color codes table, and check whether white or black text reads better on the color.
  6. Share or bookmark the page: the address bar keeps the current color, for example ?color=2db386.

What a color picker does

A color picker lets you choose a color by eye instead of typing numbers, then gives you the code for it. Used as a hex color picker, this one shows the result as HEX and 8-digit HEX with alpha, plus RGB, HSL, HSV, OKLCH and CMYK. It also names the nearest of the 148 CSS color names and shows the WCAG contrast ratio of white and black text on the color. It runs entirely in your browser, and the last color you picked is remembered in this browser (in local storage) for your next visit.

How the square and sliders work

The picker uses the HSV model (hue, saturation, value; value is also called brightness, so the same model is sometimes written HSB). The hue slider chooses a point on the color wheel, from red at 0° through yellow, green, cyan and blue back to red at 360°. The square then shows every saturation and brightness of that hue:

CSS has no hsv() function, so the picker converts the position to HEX, RGB and HSL for you. HSV and HSL share the same hue; only the other two numbers change. Lightness is L = V × (1 − S ÷ 2), and HSL saturation is (V − L) ÷ min(L, 1 − L), or 0 when L is 0 or 1. That is why the corners of the square land on these HSL values (hue 160):

Square positionHSVHEXHSL
Top lefthsv(160, 0%, 100%)#FFFFFFhsl(160, 0%, 100%)
Top righthsv(160, 100%, 100%)#00FFAAhsl(160, 100%, 50%)
Middlehsv(160, 50%, 50%)#40806Ahsl(160, 33%, 38%)
Bottom (any)hsv(160, any, 0%)#000000hsl(160, 0%, 0%)

The top edge goes from white to the purest form of the hue, which is HSL lightness 50%, not 100%. The whole bottom edge is black, so the picker remembers the hue and saturation you had, and dragging back up returns to the same color family instead of jumping to red.

Worked example

Set the hue to 160° and put the handle 75% of the way across and 70% of the way up, so S = 0.75 and V = 0.70.

The tool shows #2DB386, rgb(45, 179, 134), hsl(160, 60%, 44%) and oklch(68.53% 0.1311 165.34). The nearest CSS name is mediumseagreen (#3CB371), 0.028 away (deltaE OK), so it is close but not an exact match. White text on it has a contrast ratio of only 2.66:1, which fails WCAG AA even for large text; black text has 7.9:1, which passes AAA for normal text.

Positions in the square are rounded to whole RGB channels, and the arrow keys move in 1% steps, so not every HEX code is easy to land on by hand. To get an exact code, type it into the box.

Eyedropper: pick a color from your screen

The Pick from screen button uses the EyeDropper API. Click it, move the magnified cursor to any pixel, including pixels outside the browser window, and click to take that color; press Esc to cancel. The browser only starts picking after you click the button, and the page receives the color of the one pixel you choose, not an image of your screen.

The API is available in Chromium-based browsers on desktop, such as Chrome and Edge from version 95. As of November 2026, Firefox, Safari and mobile browsers do not have it, so the button is hidden there. In those browsers, take a screenshot and open it in the image color picker, which reads any pixel of an image.

HEX, RGB and HSL color codes

All three describe the same sRGB colors in CSS. HEX (#2DB386) is the most compact and the most widely copied format. RGB (rgb(45, 179, 134)) gives the red, green and blue channels from 0 to 255 as plain numbers, which is what you want from an RGB color picker when code expects separate channels. HSL (hsl(160, 60%, 44%)) is the easiest to adjust by hand, because you can change lightness without touching the hue. For how each conversion is calculated, see the color converter.

For transparency, copy the 8-digit HEX or rgba() row; see the color converter for how alpha is stored.

Keyboard controls

Key (square focused)Effect
Left / Right arrowSaturation down / up by 1% (10% with Shift)
Down / Up arrowBrightness down / up by 1% (10% with Shift)
Home / EndSaturation 0% / 100%
Page Down / Page UpBrightness 0% / 100%

The hue and opacity sliders are standard range inputs: arrow keys move them by one step, and Home and End jump to the ends.

Common mistakes

Key terms

Saturation-value square
The square in an HSV color picker: saturation increases from left to right and value (brightness) from bottom to top, all at the hue chosen on the hue slider.
Hue slider
A strip showing the color wheel unrolled from red at 0° through yellow, green, cyan, blue and magenta back to red at 360°. Moving it changes the hue and keeps saturation and brightness.
EyeDropper API
A browser API that lets a web page, after a click, open an eyedropper so the user can pick the color of any pixel on screen. The page receives only that color, as a HEX value. Chromium-based desktop browsers support it.
HSV
Hue, saturation and value, also called HSB (brightness). Value is the strength of the largest RGB channel, so 100% value with full saturation is the purest form of a hue. It is the model behind the square-and-slider color picker used by many graphics apps.
Hex color
A color written as a # followed by hexadecimal digits for red, green and blue, such as #4F46E5. Each pair runs from 00 to FF (0 to 255). An optional fourth pair sets opacity, and 3- or 4-digit shorthand doubles each digit.
Alpha channel
A fourth value alongside the color channels that sets opacity, from 0 (fully transparent) to 1 (fully opaque). In CSS it appears in rgba(), hsla() and 8-digit HEX, where 80 is about 50%.
deltaE OK
The straight-line distance between two colors in OKLab. A value of 0 means identical. CSS Color 4 uses it for gamut mapping and treats 0.02 as a just-noticeable difference.

Frequently asked questions

How do I get the HEX code of a color?
Pick it in the square, or with Pick from screen, and copy the HEX row. The code also appears in the text box, where you can select it.
How do I pick a color from my screen?
In Chrome or Edge on a computer, click Pick from screen, then click any pixel, even outside the browser. Other browsers do not support the EyeDropper API, so the button is hidden there; take a screenshot and open it in the image color picker instead.
Is my screen captured?
Under the EyeDropper spec, the page receives only the color of the one pixel you click, and only after you click Pick from screen; it never gets an image of your screen.
What is the difference between HSV and HSL?
They share the hue. In HSV the pure hue is at 100% value; in HSL it is at 50% lightness. See the color converter for the formulas.
How do I make a color transparent?
Lower the Opacity (alpha) slider. Copy the HEX with alpha, RGBA or HSLA row: 50% opacity of #4F46E5 is #4F46E580.
Can I share a color?
The page address updates as you pick, for example ?color=4f46e5, so copying the URL shares the exact color. The recent colors row is kept in memory only and is cleared when you leave, but the last color you picked is remembered in this browser for your next visit.

Sources: EyeDropper API (WICG draft), MDN: EyeDropper API, CSS Color Module Level 4 (W3C), WCAG 2.2 contrast ratio. Last checked 2026-11-17.