Design
Free colour contrast checker for WCAG 2.2
Check whether your text and background colours are easy enough to read, against the WCAG 2.2 AA and AAA levels. See the ratio and a live preview as you pick, get the nearest passing colour that keeps your hue, preview the pair as people with colour blindness may see it, and check a whole brand palette at once.
- WCAG 2.2 AA and AAA
- Suggested passing colours
- Palette checker
Free, no sign-up. It runs in your browser: the colours you enter are not sent to this site.
Nothing you enter leaves your browser.
This tool runs in your browser and needs JavaScript. Turn JavaScript on and reload the page.
Colour contrast checker
Contrast ratio
| What | Level | Needs | Result |
|---|
Large text is at least 18 points (24px), or at least 14 points (about 18.7px) when bold, as in the WCAG 2.2 definition (opens in a new tab). Logos and disabled controls have no contrast requirement.
Preview
The colours as you chose them.
Large text: 18 points, 24 pixels
Bold large text: 14 points, about 18.7 pixels
Normal text at 16 pixels, the size most body text uses. A sentence with a link in it shows whether links stand out.
The colour-vision previews are approximations, from the published model of Machado, Oliveira and Fernandes (2009) for the full form of each condition. Most people with a colour-vision deficiency see more colour than this, and everyone’s vision differs. Achromatopsia is shown in grey of the same luminance.
Suggest a passing colour
Finds the nearest colour that passes by changing only its lightness. The hue and colourfulness stay the same, measured in the OKLCH colour space, so the suggestion still looks like your colour.
Palette checker
Add up to 10 brand colours to see the contrast of every pair and the best level each pair reaches. Press a pair to check it above. The example colours are this site’s; replace them with yours.
Paste colours
Every code that starts with # is added, such as #1a4cc0 or #fff, up to 10 colours in all.
- AAA 7:1 or more: any text, at both levels.
- AA 4.5:1 or more: any text at AA, large text at AAA.
- AA large 3:1 or more: only large text, icons, borders and form controls.
- Fail under 3:1: do not use the pair for text or controls.
The theme.json palette is version 3, for WordPress 6.6 and later. WordPress turns each colour into a custom property such as --wp--preset--color--brand-blue, as described in the Theme Handbook (opens in a new tab).
What you can do
-
WCAG 2.2 contrast ratio with AA, AAA and non-text checks
-
Live preview of text, links, buttons and icons
-
Suggested passing colours that keep your hue
-
Colour-blindness previews, labelled as approximations
-
Palette checker for up to 10 colours, copied as CSS or theme.json
-
A link that reproduces the check
How to check colour contrast
-
Enter your two colours
Type or paste the text colour and the background colour as HEX codes, or open the picker beside each one. Lower the opacity for a see-through colour.
-
Read the ratio and the checks
The contrast ratio and a pass or fail for AA and AAA, normal and large text, and icons and controls update as you change a colour. The preview shows text, a link, buttons and an icon in your colours.
-
Fix what fails
Press Suggest a colour for the nearest passing version of the text or background colour, use it with one click, then copy the link or your checked palette as CSS or theme.json.
How colour contrast is measured
The checker uses the formula in WCAG 2.2, the Web Content Accessibility Guidelines. Each colour’s relative luminance is worked out from its red, green and blue values, from 0 for black to 1 for white, and the contrast ratio is (lighter + 0.05) ÷ (darker + 0.05). It runs from 1:1, for two identical colours, to 21:1, for black on white. The ratio is never rounded up: WCAG says 4.499:1 does not meet 4.5:1, so this checker shows it as 4.49:1.
The levels
- AA, normal text: 4.5:1. The level most accessibility laws, contracts and audits ask for (success criterion 1.4.3).
- AA, large text: 3:1. Large text is at least 18 points (24px), or 14 points (about 18.7px) in bold.
- AAA: 7:1 for normal text, 4.5:1 for large text. The enhanced level (1.4.6), worth reaching for long reading.
- Icons, borders and form controls: 3:1. The outline of a text field, a checkbox, a focus ring or an icon that carries meaning, against what is next to it (1.4.11).
WCAG 2.1 and 2.2 have the same contrast rules, so a pass here is a pass for either. Text in a logo, and controls that are disabled, have no contrast requirement.
See-through colours
A colour with transparency, such as rgba(0, 0, 0, 0.6) or #00000099, shows part of what is behind it. The checker mixes it with that colour first, the way a browser paints it, and works out the contrast of the result. A see-through background is laid over white or black, whichever you choose, and the tool tells you the colour it ended up with.
Suggested colours
The suggestion changes only the lightness of your colour, in the OKLCH colour space, where equal steps look like equal changes in lightness to the eye. The hue and colourfulness stay put, so a brand blue stays the same blue, only darker or lighter. When a lighter or darker version of a very bright colour cannot be shown on a screen, it is made slightly less colourful until it fits. Every suggestion is checked again before it is shown.
In WordPress
In a block theme the colours live in the theme’s theme.json file, under settings.color.palette, and WordPress makes a custom property such as --wp--preset--color--primary for each one (see the Theme Handbook). Paste the palette into the checker to see which pairs are safe for text before you add them, and use “Copy as theme.json palette” to take the result back. In a classic theme the colours are usually in the Customizer or in style.css.
The block editor has its own check: when you set a text or background colour on a block and the pair fails AA, it warns “This color combination may be hard for people to read.” It skips colours with transparency, and it only knows the colours set on that block, not a background image or a parent block’s colour. Use this checker for those cases, and for buttons, icons and form fields the editor does not check.
What it cannot check
The checker compares two flat colours. Text on a photo or a gradient needs checking against its lightest and darkest parts, or a solid overlay behind it. It cannot see your live site, hover and focus states, or how thin a font is. A future version of WCAG may use a different way to measure contrast, but nothing is final yet; WCAG 2.2 is what accessibility laws and audits use today.
Frequently asked questions
What contrast ratio do I need?
For WCAG 2.2 level AA, which most accessibility laws and audits ask for, body text needs 4.5:1 and large text needs 3:1. Icons, input borders and other parts of controls need 3:1 against what is next to them. Level AAA asks for 7:1 for body text and 4.5:1 for large text.
What counts as large text?
Text of at least 18 points, which is 24 pixels, or at least 14 points, about 18.7 pixels, when it is bold. Most body text, at 16 pixels, is normal text, so it needs 4.5:1. Headings are often large enough for 3:1, but check the size they really show at on phones.
Why does 4.49:1 fail when it is so close to 4.5:1?
WCAG’s thresholds are exact: its own guidance says the ratio is not rounded, so 4.499:1 does not meet 4.5:1. The checker never rounds up: it cuts the ratio to two decimals, so 4.4999:1 shows as 4.49:1, and a ratio shown as 4.5:1 or more always passes 4.5:1. Use “Suggest a passing colour” to find the nearest colour that does pass.
Is anything I enter sent to this site?
No. The contrast is worked out in your browser and the colours you enter are not sent to this site. They are added to this page’s address so you can copy a link that opens the same check, which means the address, with its colours, reaches the site like any page request when the page is reloaded or the link is opened. The page asks your browser not to pass the full address on to the next page you visit. The site counts that the tool was used, never which colours. The privacy policy has the details.
How accurate are the colour-blindness previews?
They are approximations. Protanopia, deuteranopia and tritanopia use the published matrices of Machado, Oliveira and Fernandes (2009) for the full form of each condition; achromatopsia is shown as grey of the same luminance. Most colour-blind people have a milder form and see more colour than the preview, and everyone’s vision differs. They are useful for spotting pairs that only differ by hue, which is also why WCAG does not let colour alone carry meaning.
How do I fix a failing colour in my WordPress theme?
Pick a passing colour with the suggestion, then change it where your theme keeps its colours: Appearance › Editor › Styles › Colors in a block theme (or the theme.json palette), or the Customizer in a classic theme. If the colour comes from a page builder or a plugin, change it in that plugin’s settings. Change a palette colour rather than single blocks, so every use of it is fixed at once.
Can I check transparent colours and dark mode?
Yes. Lower the opacity, or type the colour with its alpha such as #1a4cc080, and the checker mixes it with the background first. For a see-through background, choose whether white or black is behind it. For dark mode, check the dark pair separately: swap in your dark background and text colours, or add both palettes to the palette checker.
Related tools
-
Colour palette generator
New (added recently)Browse 240 colour palettes or build one from your brand colour, each with a dark mode version, contrast checks and code to copy.
-
Favicon generator
New (added recently)Make favicon.ico, Apple and Android icons and a web app manifest from your logo or a letter, in your browser.
-
Email signature generator
New (added recently)Make an HTML email signature that works in Outlook, Gmail and Apple Mail, with a desktop, mobile and dark mode preview.
-
Create a WordPress child theme with style.css, functions.php and a ZIP download.