Color Picker

Type or paste a HEX code, rgb(), hsl(), hsv(), cmyk() or a CSS color name, for example #ff5733 or 255, 87, 51.

Picking a color from anywhere on the screen needs the EyeDropper API, available in Chrome, Edge and Opera on desktop. In other browsers, use the system color picker.

Result

HEX
RGB
HSL
HSV / HSB
CMYK (approximate)
Nearest CSS name
#4169E1 · ΔE 9.9

CMYK uses the simple device formula without a printer profile, so treat it as a starting point; print shops convert with ICC profiles and get different values.

Contrast (WCAG 2.2)

Sample text

On white: 5.16:1

  • AA, normal text (4.5:1): Pass
  • AA, large text (3:1): Pass
  • AAA, normal text (7:1): Fail
  • AAA, large text (4.5:1): Pass

Sample text

On black: 4.06:1

  • AA, normal text (4.5:1): Fail
  • AA, large text (3:1): Pass
  • AAA, normal text (7:1): Fail
  • AAA, large text (4.5:1): Fail

About this tool

This color picker lets you choose a color visually or paste a code and instantly see it in every common format: HEX, RGB, HSL, HSV and CMYK. It works as a HEX to RGB and RGB to HEX converter, finds the nearest CSS color name and checks the contrast of the color against white and black with the WCAG formula. In Chrome and Edge on a desktop computer you can also pick a color from anywhere on your screen with the eyedropper.

Designers and developers use it to carry a brand color between design tools, CSS and print specifications, and to check quickly whether a color is readable as text. Every value has its own copy button, and the share link keeps the selected color.

How it works

Drag in the large square to set saturation and brightness, and use the hue slider to move around the color wheel. The opacity slider adds an alpha channel, shown as 8-digit HEX, RGBA and HSLA. You can also type or paste any supported value into the color field, such as #FF5733, rgb(255 87 51), hsl(11, 100%, 60%), cmyk(0, 66, 80, 0) or tomato.

Conversions follow the CSS color definitions. HEX writes the red, green and blue channels in base 16, so FF stands for 255. HSL and HSV describe the same sRGB values by hue, saturation and lightness or value (HSV is also called HSB). CMYK uses the simple formula K=1−max⁡(R′,G′,B′)K = 1 - \max(R', G', B') without a printer profile. The contrast ratio is (L1+0.05)/(L2+0.05)(L_1 + 0.05) / (L_2 + 0.05), where L1L_1 and L2L_2 are the relative luminances of the lighter and the darker color; translucent colors are first blended with the background.

Example

The color #FF5733 is rgb(255, 87, 51): FF in hexadecimal is 255, 57 is 87 and 33 is 51. The same color is hsl(11, 100%, 60%), hsv(11, 80%, 100%) and approximately cmyk(0%, 66%, 80%, 0%). Its nearest CSS name is tomato (#FF6347).

For text, the gray #767676 on white has a contrast ratio of 4.54:1, which passes WCAG AA for normal text, while the slightly lighter #777777 reaches only 4.48:1 and fails. The tool truncates ratios instead of rounding them up, so a color that fails AA never shows as 4.50:1.

Assumptions and limits

All colors are sRGB with 8 bits per channel, as in CSS. HSL, HSV and CMYK values are rounded to whole numbers for display, so converting a rounded value back can differ by one step in a channel. CMYK is a naive device-independent conversion and does not match a specific printer, paper or ICC profile. The eyedropper requires the EyeDropper API, available in Chromium-based desktop browsers. Wide-gamut formats such as Display P3, LAB and OKLCH are not converted. Contrast checks follow WCAG 2.2 and do not replace testing with real users.

Frequently asked questions

How do I convert HEX to RGB?

Split the six-digit code into three pairs and convert each pair from base 16 to base 10. For #1E90FF, 1E is 30, 90 is 144 and FF is 255, so the color is rgb(30, 144, 255). Paste a HEX code into the color field and the tool shows the RGB value instantly.

How do I convert RGB to HEX?

Convert each channel from 0 to 255 into a two-digit base 16 number and join them after a # sign. For rgb(255, 87, 51), 255 is FF, 87 is 57 and 51 is 33, which gives #FF5733. You can type the three numbers separated by commas, such as 255, 87, 51.

What contrast ratio do I need for readable text?

WCAG 2.2 level AA requires at least 4.5:1 for normal text and 3:1 for large text (about 24 px, or about 19 px in bold). Level AAA requires 7:1 and 4.5:1. The tool shows the ratio against white and black backgrounds and marks each level as passed or failed.

Why do my CMYK values differ from Photoshop or a print shop?

Professional software converts with ICC color profiles that describe a specific printing process, ink and paper. This tool uses the simple mathematical formula, which is useful as a rough reference but not for print proofs.

Why can't I use the eyedropper?

Picking colors from the screen uses the EyeDropper API, which is currently available in Chrome, Edge and Opera on desktop. Safari, Firefox and mobile browsers do not support it yet. There you can use the system color picker or paste a HEX code from another app.

Link with your values

Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.

ParameterValueIf omitted
colorColor valuecolour: hex without # (3b82f6) or a CSS namerequired

Examples

  • ?color=ff5733
  • ?color=tomato
  • ?color=1e90ff80

Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.

Result elements: [data-result-block="color"]