Contrast checker
What do the numbers mean?
- ✔︎ Passes AAA: Contrast of 7 or above passes the strongest level of Web Content Accessibility Guidelines (WCAG).
- ✔︎ Passes AA: Most text needs contrast of 4.5 or more to meet the minimum required on UK public sector websites and apps.
- ✘ Fails with exceptions (fx): Larger text (at least 18pt, or 14pt bold) and interactive components need contrast of 3 or more. Regular text fails at this level.
- ✘ Fails (F): Contrast below 3 fails to meet the standard.
Each colour code has three or six digits, split into red, green and blue components. Use the colour list to help find a code.
Colour list
Only named colours are currently visible.
These colours are sorted by hue, then how colourful they are, then darkest to lightest.
reds
yellows
greens
cyans
blues
magentas
greys
Within each section, each colour is sorted by how vivid it is, then in rainbow order, then darkest to lightest.
reds
yellows
greens
cyans
blues
magentas
greys
vividness |
codes (black to white) |
About
I regularly check colours for accessibility but when I started making this, there were very few other ways to check for several colours at the same time, so this became a learning project to make an accessible contrast checker. This was made using "vanilla" Javascript on a canvas element and without AI 🧠.
Other contrast checkers
The following tools are all free and help you check colour contrast on the web.
Credits
The contrast checker "borrows" code from several places and these are highlighted as comments in the Javascript file.
Colour names come from a number of sources, and I've made up a few. Particular thanks to:
Latest updates
This is an updated version of the contrast checker. The main changes in this version are:
- The list of colours has been completely revamped and made more accurate.
- The complex "tint" system has been removed in favour of a simpler list of colours.
- The last-entered colour can be removed.
- Focus management on the contrast checker has been removed.
- The colour chart is separated out into a separate poster.