Color Picker

Pick colours, convert HEX, RGB and HSL, and check contrast.

#3366CCClick the swatch to pick a colour, or type a value below in any format.

Contrast

#3366CC on #FFFFFF5.36:1Readable for body text under WCAG AA.
Large textBody text at 14px reads like this.
Large textBody text at 14px reads like this.
WCAG 2Normal textLarge text
AAPass(4.5:1)Pass(3:1)
AAAFail(7:1)Pass(4.5:1)
Against white5.36:1Passes AA
Against black3.91:1Fails AA for body text

Large text means at least 24px, or 18.66px in bold. Ratios are rounded down, so a colour shown as 4.5:1 really reaches it.

Three ways to write the same colour

#3366CC = rgb(51, 102, 204) = hsl(220, 60%, 50%)

Type into any of the three fields and the other two update. HEX also accepts the three-digit short form, such as #36C, and RGB and HSL accept both the comma form and the newer space-separated CSS form.

How contrast is calculated

WCAG measures contrast from the relative luminance of each colour: how bright it appears, with green weighted most and blue least, because that is how the eye responds. The ratio compares the lighter colour with the darker one.

Contrast ratio = (L1 + 0.05) ÷ (L2 + 0.05)

L1 is the luminance of the lighter colour and L2 of the darker one. The result runs from 1:1 for two identical colours to 21:1 for black on white. The order does not matter.

Choosing accessible colours

  • Check every text colour against every background it appears on, including hover and disabled states.
  • Brand colours that are mid-tones often fail for small text. Use a darker shade for text and keep the brand colour for larger elements.
  • Do not rely on colour alone to show meaning, such as red for an error; add an icon or a label too.
  • Contrast also matters for charts, focus rings and input borders, which need at least 3:1 against their surroundings.

Frequently asked questions

What is the difference between HEX, RGB and HSL?

They describe the same colours in different ways. HEX and RGB both give the amount of red, green and blue, as hexadecimal pairs or as numbers from 0 to 255. HSL gives a hue angle on the colour wheel, a saturation and a lightness, which makes it easier to create lighter or darker versions of a colour by hand.

Why does converting HSL to HEX sometimes change the value slightly?

HEX and RGB only allow whole numbers from 0 to 255 per channel, and HSL shown here uses whole degrees and percentages. Converting between them rounds, so a colour can move by one step. The difference is not visible on screen.

What contrast ratio do I need?

WCAG 2 level AA asks for at least 4.5:1 for normal text and 3:1 for large text and for icons and form borders. Level AAA asks for 7:1 for normal text and 4.5:1 for large text.

What counts as large text?

Text of at least 18 points, which is 24 CSS pixels, or at least 14 points bold, which is about 18.66 CSS pixels. Most body text on the web is 14 to 18 pixels, so it counts as normal text.

Is the colour picker the same in every browser?

The swatch opens your browser's or operating system's own picker, so it looks different in Chrome, Safari and Firefox. Some of them include an eyedropper for picking a colour from anywhere on screen. The text fields work the same everywhere.

Related tools

All tools