Color Contrast Checker

Contrast ratio—
AA normal text (4.5:1)—
AA large text (3:1)—
AAA normal text (7:1)—
AAA large text (4.5:1)—

How Color Contrast Checker is calculated: Ratio = (lighter luminance + 0.05) ÷ (darker luminance + 0.05); luminance = 0.2126R + 0.7152G + 0.0722B after linearising each channel. Black on white = 21.00.

What is a colour contrast checker?

A colour contrast checker measures how easy text is to read against its background. It takes two colours, a foreground and a background, and returns a contrast ratio: a number from 1, which means the two colours are identical, to 21, which means black on white, the strongest contrast possible. It then says whether that ratio passes the WCAG accessibility rules for normal text and for large text.

The default on this page is black text on a white background, #000000 on #FFFFFF. The ratio is 21.00, the maximum, and it passes every WCAG level: AA normal, AA large, AAA normal, and AAA large. That is the benchmark every other combination is measured against.

Contrast matters because text that is hard to read is text that is not read. A light grey on white, a pale yellow on cream, a mid orange on white: all of them look fine in a design tool and fail in real life, especially on a phone in sunlight or for a reader with low vision. The checker turns a judgement call into a number.

Everything runs in your browser. The colours you type never leave your device, and there is no account to create. Type two hex codes and the ratio and the four pass-or-fail results appear instantly.

How WCAG contrast is calculated

The WCAG formula starts from relative luminance, which is how bright a colour looks to the human eye, on a scale from 0 for black to 1 for white. Each channel is linearised first, because screens store colour in a gamma curve and the eye does not see light linearly. A channel value of 119 out of 255, which is #77, linearises to about 0.18, not 0.47.

The three linearised channels are then weighted: red counts for 21.26 percent, green for 71.52 percent, and blue for 7.22 percent. Green dominates because the human eye is most sensitive to green light. That is why a pure green looks brighter than a pure red or a pure blue at the same channel value, and why the weights are not equal.

The ratio itself is the lighter luminance plus 0.05, divided by the darker luminance plus 0.05. The 0.05 stops the ratio from going to infinity when one colour is pure black. Black has a luminance of 0 and white has a luminance of 1, so the ratio is 1.05 divided by 0.05, which is 21.00, the maximum possible.

The thresholds are fixed by WCAG 2. AA normal text needs a ratio of at least 4.5 to 1. AA large text needs at least 3 to 1. AAA normal text needs at least 7 to 1, and AAA large text needs at least 4.5 to 1. Large text means 18 point or larger, or 14 point bold or larger. This checker applies all four thresholds to your two colours and reports each one.

The thresholds, and what they mean in practice

AA normal at 4.5 to 1 is the rule most websites have to meet. It is the legal baseline in many countries and the target in most design systems. A grey of #767676 on white gives a ratio of 4.54, which just passes. A grey of #777777 on white gives 4.48, which just fails. The line between pass and fail runs right through the mid greys, which is why grey text is the most common contrast failure on the web.

AA large at 3 to 1 is the easier bar, because large text is easier to read. #FF5733 on white gives a ratio of 3.15, which fails AA normal but passes AA large. That means the same orange-red is fine for a big heading and not fine for body text. Size changes the rule, and the checker reports both so you can see where a colour is allowed.

AAA normal at 7 to 1 is the strictest bar, and few body-text colours pass it. #595959 on white gives 7.00, which just passes. Black on white gives 21.00, which passes with room to spare. AAA is the target for sites that serve older readers or readers with low vision, and it usually means dark text on a light background, or the reverse.

AAA large at 4.5 to 1 is the same number as AA normal, applied to large text. That overlap is convenient: a colour that passes AA normal text automatically passes AAA large text. The four results on this page are not four independent rules; they are two numbers, 4.5 and 7, applied at two sizes.

A worked example: four pairs, four verdicts

First, the default: black #000000 on white #FFFFFF gives a ratio of 21.00. All four checks pass: AA normal, AA large, AAA normal, AAA large. This is the strongest contrast possible, and it is the pair to compare everything else against.

Second, mid grey on white: #777777 on #FFFFFF gives a ratio of 4.48. AA normal fails, because 4.48 is below 4.5. AA large passes, because 4.48 is above 3. AAA normal fails, and AAA large fails, because 4.48 is below 4.5 and below 7. One hundredth of a ratio point is the difference between passing and failing AA normal, which is why the checker shows two decimals.

Third, the orange-red: #FF5733 on #FFFFFF gives a ratio of 3.15. AA normal fails and AAA normal fails, but AA large passes, because 3.15 is above 3. So this colour works for headings and buttons with large text, and does not work for paragraphs. That is a common pattern for brand colours: vivid enough for display type, not strong enough for body copy.

Fourth, dark grey on white: #595959 on #FFFFFF gives a ratio of 7.00. All four checks pass, including AAA normal, because 7.00 meets the 7 to 1 bar. It is the lightest grey that passes AAA normal text on white, and it is the grey most accessible design systems use for body text when pure black feels too harsh.

Who uses a contrast checker, and why

Web developers use it every time they pick a text colour. A design file says the body text is a soft grey, the checker says the ratio is 4.48, and the developer darkens it one step to #767676, which passes at 4.54. That is a thirty-second check that stops an accessibility failure before it ships.

Designers use it to defend a palette. A brand colour that fails AA normal text is not a bad colour; it is a colour with a job. It can be the heading colour, the button colour, or the accent, while a darker shade of the same hue does the body text. The checker shows which job each colour can do.

Content teams use it for documents and slides. A presentation with light grey text on a white slide is unreadable from the back of a room, and a report with pale blue links on a white page is unreadable in print. The same WCAG numbers apply, because the eye does not care whether the text is on a screen or on paper.

Product teams use it for compliance. Accessibility laws in many countries point at WCAG AA, and a contrast checker is the fastest way to prove a page meets it. A readability score checker covers the words themselves, and an image contrast tool adjusts the contrast of pictures; this checker covers the text colours that sit on top of them. A background color changer is the place to see a text-and-background pair filling a whole page before it ships.

Contrast checker vs a readability checker

A contrast checker measures whether text can be seen. A readability checker measures whether text can be understood. They are different jobs, and a page needs both: text that is easy to see but hard to understand fails the reader just as surely as text that is easy to understand but impossible to see.

The contrast checker works on colours. It takes two hex codes and returns a number, with no interest in what the words say. The readability checker works on words: it takes a passage and returns a score based on sentence length and word length. One is about the eye, the other is about the brain.

A page can pass one and fail the other. Black text on white at 21.00 contrast is perfectly readable in the contrast sense, and still unreadable if the sentences are fifty words long. Pale grey text at 3.15 contrast can carry beautifully simple sentences that nobody can see. Both checks matter, and neither replaces the other.

Use them together. Check the colours here, then check the words with a readability score checker. A page that passes both is a page people can actually read, which is the whole point of publishing it. A meta tag generator is the next step when the page itself is ready and needs to be found, and a SERP preview tool shows how the page title and description look in search results.

Common contrast mistakes

The first mistake is grey text on a white background. It looks elegant in a design tool and fails in real life. The most common failing grey is #777777 at 4.48, just under the AA bar. Darken it to #767676 at 4.54 and it passes. One step darker is the difference between a pass and a fail.

The second mistake is coloured text on a coloured background. A brand orange on a brand blue can look striking and still fail every threshold, because contrast depends on luminance, not on how different the hues are. Two colours can be far apart on the wheel and close together in luminance. Always check the number, never trust the hue difference.

The third mistake is forgetting the large-text rule. A colour that fails AA normal can still pass AA large, and a heading at 24 point is large text. But body text is never large text, and a button label at 14 point regular is not large text either. Large means 18 point or larger, or 14 point bold or larger, and nothing smaller counts.

The fourth mistake is checking only one state. A link that passes in its normal state can fail in its hover state, and a button that passes with white text can fail when it is disabled and the text turns grey. Check every state a user will actually see, not just the default one.

How to use this colour contrast checker

Type the foreground colour into the first box and the background colour into the second, as hex codes, with or without the hash sign. The ratio and the four pass-or-fail results appear instantly as you type. There is no button to press.

Read the ratio first. 21.00 is the maximum, 1.00 means the two colours are identical, and 4.5 is the AA bar for normal text. Then read the four results: AA normal, AA large, AAA normal, AAA large. A colour that passes AA normal is safe for body text; a colour that only passes AA large is safe for headings.

If a pair fails, darken the text or lighten the background until the ratio crosses the bar you need. One step darker on a grey usually moves the ratio by about 0.5, so a failing 4.48 often passes at 4.54 with a single step. The checker updates live, so you can walk the colour up or down until it passes.

Everything runs in your browser. No sign-up, no account, no data sent anywhere. The colours you typed never leave your device, and the page works offline once it has loaded.

Frequently Asked Questions

21.00, the maximum possible. Black has a relative luminance of 0 and white has a luminance of 1, so the ratio is 1.05 divided by 0.05, which is 21.00. It passes every WCAG level: AA normal, AA large, AAA normal, and AAA large.

At least 4.5 to 1 for WCAG AA, which is the standard most websites must meet. A grey of #767676 on white gives 4.54 and passes, while #777777 on white gives 4.48 and fails. For the stricter AAA level, normal text needs at least 7 to 1, which #595959 on white meets at exactly 7.00.

Only for large text. #FF5733 on white gives a ratio of 3.15, which passes AA large (3 to 1) but fails AA normal (4.5 to 1) and both AAA levels. Use it for headings at 18 point or larger, or 14 point bold, and use a darker colour for body text.

Because the human eye is most sensitive to green light. The WCAG luminance formula weights green at 71.52 percent, red at 21.26 percent, and blue at 7.22 percent. That is why a pure green looks brighter than a pure red or blue at the same channel value, and why two colours with the same RGB average can have very different contrast ratios.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.