Web Text Contrast Checker
Enter a text colour and a background colour to see the contrast ratio and whether the pairing meets WCAG guidelines for normal and large text.
Web Text Contrast Checker
Result
4.54 : 1
Sample text for checking contrast
What the Web Text Contrast Checker does
The Web Text Contrast Checker measures how easy it is to read text on a background colour. You enter the text colour and the background colour, and the tool calculates the contrast ratio and compares it with the levels in the Web Content Accessibility Guidelines, usually called WCAG. A live preview shows your pairing so you can judge it by eye as well.
Designers, developers and content editors use the tool to check buttons, navigation, captions and body text before a page goes live. Low contrast is one of the most common barriers for people with low vision, colour vision differences and ageing eyes, and it also makes text harder to read in bright sunlight on a phone.
How the contrast ratio is calculated
The tool first converts each colour to relative luminance. It takes each red, green and blue channel, scales it from 0 to 1, applies the gamma correction used in the WCAG formula, and combines the three channels using weights of 0.2126 for red, 0.7152 for green and 0.0722 for blue. The result is a value from 0 for black to 1 for white.
The contrast ratio is then the lighter luminance plus 0.05, divided by the darker luminance plus 0.05. The ratio runs from 1 to 1, for two identical colours, up to 21 to 1, for black on white. The tool shows two decimal places, rounded down as WCAG presents the figure.
The WCAG levels
WCAG has two levels for text contrast. Level AA requires a ratio of at least 4.5 to 1 for normal text and 3 to 1 for large text. Level AAA is stricter, requiring 7 to 1 for normal text and 4.5 to 1 for large text. Many organisations and public services aim for AA as a minimum.
Large text means 18 point or larger, which is about 24 CSS pixels, or 14 point bold or larger, which is about 18.7 CSS pixels in bold. Headings often qualify, but body text usually does not.
Worked examples
Grey text with the hex value #767676 on a white background gives a ratio of about 4.54 to 1. That passes AA for normal text, because it is above 4.5, but it fails AAA, which needs 7 to 1.
A slightly lighter grey, #777777, on white gives about 4.48 to 1. That fails AA for normal text, even though it looks almost identical. It passes AA for large text, which needs only 3 to 1. Small changes near the threshold matter, so always test the exact colours you use.
Black text, #000000, on white gives 21 to 1, the highest possible ratio, which passes every level.
Choosing accessible colour pairs
Start with the level you need. If you are aiming for AA, check body text first, then headings, buttons and form labels. Colours that look fine on a large screen may fail on a small one under strong light.
When a pairing fails, darken the text, lighten the background or move to a different hue with more difference in lightness. Adjusting lightness is usually more effective than changing the hue, because contrast depends mainly on brightness.
Limitations
A contrast ratio is one check among many. It does not test text over images or gradients, where the background varies, and it does not account for font weight, letter spacing or the size of the text on a particular screen. Placeholder text in forms and disabled controls have their own rules in WCAG. Use the tool to find problems quickly, then review pages with an accessibility checker and, where possible, real users.
The tool does not check colour blindness simulations or the visual differences between screens. Test on the devices your readers actually use.
Checking a full page
Test every text colour against every background it appears on. A page often has several greys and blues, and one failing pairing can affect headings, links, buttons and the small print in a footer. Make a short list of your brand colours and check each combination you use, including hover and focus states.
Focus indicators also need enough contrast against the surrounding colours, because keyboard users rely on them. Check the outline colour against the page background, not only the text colour, and keep error messages readable in both light and dark themes.
Designing for dark mode
Many readers switch to dark themes, and a pairing that passes in light mode can fail in dark mode, because the background and text colours change together. Check both themes separately, and avoid pure white text on pure black, which can cause glare for some readers. A softer off-white on a dark grey is often easier to read and still gives a strong ratio.
Using contrast results with a design team
Record the ratio, the level it meets and the page where the pairing appears in your design notes. A shared record helps designers, developers and writers agree on changes quickly, and it stops a later redesign from quietly bringing back a failing combination.
Choosing a colour when the first attempt fails
When a pairing fails, change one colour at a time and record the ratio after each step. Move the text colour a little darker or lighter, check again, then decide whether the background also needs to change. Keeping a record of each attempt helps a team agree on the final choice without repeating the same tests.
Privacy
The colour values you enter stay in your browser. Nothing is sent to a server, so you can test designs before launch without sharing them.
Frequently Asked Questions
What contrast ratio do I need?
For normal text, WCAG AA needs 4.5 to 1 and AAA needs 7 to 1. For large text, AA needs 3 to 1 and AAA needs 4.5 to 1.
Does this tool check images or gradients?
No. It compares two solid colours. Check text over images or gradients separately, because the background changes behind the text.
What is large text?
Text of 18 point or larger, or 14 point bold or larger, which is roughly 24 CSS pixels or 18.7 CSS pixels in bold.
Is a ratio of 4.5 enough for every text?
It is the AA minimum for normal text. Some designs need AAA, which asks for 7 to 1, and text on images or gradients needs separate checks.
Does WCAG apply to logos and decorative text?
WCAG exempts logotypes and purely incidental text from the text contrast requirement, although logos should still be clear where they carry information.
Related Tools
By the ToolHuby editorial team. Last updated November 16, 2026.