Written and maintained by the Progression Agency strategy team
This color contrast checker works out the color contrast ratio between a text color and its background with the formula in WCAG 2.2, then tells you whether the pair passes AA and AAA for normal and large text and the 3:1 minimum for non-text contrast. Paste a hex code, rgb() or hsl() value, or pick a color, and the panel also suggests the nearest shade that passes and grades a whole palette at once. Progression, the web design and accessibility team that builds and fixes sites for growing companies, made it and gives it away; every calculation runs in your browser.
On this page · 14 sections
- How to use the color contrast checker
- WCAG contrast requirements at a glance
- How is the color contrast ratio calculated?
- Why a 4.499:1 pair still fails the 4.5:1 line
- What counts as large text?
- Non-text contrast for buttons, inputs, icons and charts
- Links told apart from body text by color alone
- Building accessible color combinations from a brand palette
- How the suggested colors are found
- Text on photos, gradients and layered backgrounds
- Mistakes that make a contrast check wrong
- WCAG versions, ISO and the DOJ web rule
- Accessible design and remediation from Progression
- More free tools and design reading
Before you start Take colors from the stylesheet or the design file rather than from a screenshot. W3C notes that anti-aliasing can draw thin type fainter than the color it was given, so a picked pixel can read lower than the real value.
Figures labeled Illustrative example. are invented to show the arithmetic. Formulas, thresholds and definitions are described as the W3C WCAG 2.2 Recommendation and its Understanding documents state them as of November 24, 2026, and every ratio on this page was produced by the same code that runs the checker.
Color contrast checker for WCAG 2.2
Type or pick a text color and a background color to get the contrast ratio, a pass or fail for AA and AAA text and for non-text contrast, a live preview, the nearest passing shades and a palette matrix for up to eight brand colors.
Turn on JavaScript to use the color contrast checker.
Runs entirely in your browser: the colors you enter never leave this page, nothing is saved between visits, and the palette CSV file is built on your device when you press the button.
The panel opens with an illustrative example already loaded: #777777 gray text on white, a pair that looks readable yet misses the AA line for body copy by a hair. Change either color and every result, the preview and the suggestions update as you type.
How to use the color contrast checker
Use the color contrast checker by entering a text color and a background color; the contrast ratio and a pass or fail for each WCAG level appear straight away. Each color can be typed as a code or chosen with the color picker beside it, and the two stay in step.
- Type or pick the text (foreground) color.
- Type or pick the background color the text sits on.
- Lower the opacity slider if the text is see-through, or include alpha in the code.
- Read the ratio and the five pass or fail rows under it.
- Enter a font size to learn whether your text counts as large text.
- Press Use this on a suggested shade to apply the nearest passing color.
- Add up to eight brand colors to the palette check and download the matrix as a CSV file.
Which color formats does the checker read?
Hex codes with 3, 4, 6 or 8 digits, with or without the # sign, rgb() and rgba() in comma or space syntax, hsl() and hsla() with degrees, turns or radians, and all 148 named colors listed in CSS Color Module Level 4, from aliceblue to yellowgreen. An entry it cannot read turns red with a message instead of being guessed.
What happens to a see-through text color?
Contrast is measured on the color a reader actually sees, so a text color with alpha is first blended over the background. The checker uses the simple alpha compositing formula from the W3C Compositing and Blending specification, rounds the result to whole 0 to 255 channels, and shows the blended hex code beside the ratio.
- Illustrative example. Black text at 50% opacity on white blends to #808080, a ratio of 3.95:1.
- A background with alpha is blended over white, the color WCAG assumes when none is specified, and the checker says so.
- Fully transparent text takes on the background, so the ratio falls to 1:1.
- Nothing is stored or sent anywhere: reload the page and the example returns.
WCAG contrast requirements at a glance
WCAG contrast requirements come down to three numbers: 4.5:1 for normal text and 3:1 for large text at Level AA, 7:1 and 4.5:1 at Level AAA, and 3:1 for the parts of controls and graphics that people need to see. The WCAG 2.2 Recommendation sets them in success criteria 1.4.3, 1.4.6 and 1.4.11.
| Success criterion | Level | Applies to | Minimum contrast ratio |
|---|---|---|---|
| 1.4.3 Contrast (Minimum) | AA | Normal text and images of text | 4.5:1 |
| 1.4.3 Contrast (Minimum) | AA | Large text (18pt, or 14pt bold) | 3:1 |
| 1.4.6 Contrast (Enhanced) | AAA | Normal text and images of text | 7:1 |
| 1.4.6 Contrast (Enhanced) | AAA | Large text (18pt, or 14pt bold) | 4.5:1 |
| 1.4.11 Non-text Contrast | AA | UI component boundaries, states and meaningful graphics | 3:1 against adjacent colors |
| 1.4.1 Use of Color (with technique G183) | A | Links marked by color alone, compared with nearby text | 3:1 between link and text |
AA and AAA: two levels of one test
AA and AAA use the same formula with different minimums. Level AA is the level the DOJ Title II web rule points to through WCAG 2.1, while AAA asks for 7:1 on normal text and 4.5:1 on large text. W3C explains that 4.5:1 compensates for the contrast sensitivity loss that comes with roughly 20/40 vision and 7:1 for roughly 20/80.
Text that the contrast criteria leave out
SC 1.4.3 lists three exceptions: text inside an inactive user interface component, text that is pure decoration or not visible to anyone, and text that forms part of a logo or brand name. Understanding 1.4.3 adds that brand guidelines on their own do not exempt ordinary text from the requirement.
- A disabled submit button may keep its low contrast gray text.
- Random background words that carry no meaning count as decoration.
- A street sign that happens to appear in a photograph is incidental text.
- A company wordmark is exempt; a headline set in the brand color is not.
How is the color contrast ratio calculated?
The color contrast ratio is the relative luminance of the lighter color plus 0.05, divided by the relative luminance of the darker color plus 0.05. WCAG 2.2 defines both terms, results run from 1:1 for two identical colors to 21:1 for black on white, and the checker shows the division with your numbers in it.
Relative luminance step by step
Relative luminance is the brightness of a color on a scale where black is 0 and white is 1. Each sRGB channel is divided by 255, linearized with the curve WCAG prescribes, and then weighted: 0.2126 for red, 0.7152 for green and 0.0722 for blue, which is why greens look so much brighter than blues of the same code value.
| Step | What WCAG 2.2 defines | #777777 on #FFFFFF |
|---|---|---|
| 1. Scale to 0 to 1 | Channel = 8 bit value ÷ 255 | 119 ÷ 255 = 0.4667 |
| 2. Linearize | ÷ 12.92 at or below 0.04045, else ((c + 0.055) ÷ 1.055) ^ 2.4 | 0.1845 |
| 3. Weight the channels | L = 0.2126 R + 0.7152 G + 0.0722 B | 0.1845 for the gray, 1 for white |
| 4. Order the pair | L1 is the lighter color, L2 the darker | L1 = 1, L2 = 0.1845 |
| 5. Divide | (L1 + 0.05) ÷ (L2 + 0.05) | 1.05 ÷ 0.2345 = 4.478 |
| 6. Compare unrounded | 4.478 is below 4.5 | Fails AA normal text, passes AA large |
Why does the formula add 0.05?
The 0.05 stands for ambient light reflecting off a screen. Understanding 1.4.3 says the value comes from the typical viewing flare figure in the sRGB standard, and adding it to both luminances also keeps the ratio finite when one color is pure black.
The 0.04045 threshold and the older 0.03928
WCAG 2.2 linearizes a channel by simple division when its scaled value is at or below 0.04045. Before May 2021 the definition used 0.03928, a figure carried over from an older text; W3C notes the change has no practical effect, and for 8 bit colors none can arise, because 10 ÷ 255 is 0.0392 and 11 ÷ 255 is 0.0431, so no channel lands between the two values.
Why a 4.499:1 pair still fails the 4.5:1 line
A ratio just under a threshold fails, because W3C says computed ratios are compared without rounding. Understanding 1.4.3 gives 4.499:1 as a ratio that does not meet 4.5:1, and Understanding 1.4.11 says the same of 2.999:1 against 3:1.
How this contrast ratio calculator shows two decimals
The contrast ratio calculator rounds the display to the nearest hundredth, except that it never shows a value at or above 3, 4.5 or 7 when the true ratio is below it. Illustrative example. #007BC8 on white works out to 4.4995:1; ordinary rounding would print 4.50, so the checker prints 4.49:1 and marks AA normal text as failed.
- Pass and fail always come from the unrounded ratio.
- #0099FF on white is 2.9998:1, shown as 2.99:1, and fails the 3:1 line.
- #215A9B on white is 6.9990:1, shown as 6.99:1, and fails AAA for normal text.
- Results also say Pass or Fail in words, so the verdict never depends on color alone.
What counts as large text?
Large text is text of at least 18 point, or at least 14 point when it is bold. Understanding 1.4.3 converts points to CSS pixels at 1pt = 1.333px, putting the lines at roughly 24px for regular weight and about 18.5px to 18.7px for bold, and large text needs only 3:1 at AA.
| Font size | In points (1pt = 1.333px) | Weight | Counts as | AA minimum |
|---|---|---|---|---|
| 16px | 12pt | Regular or bold | Normal text | 4.5:1 |
| 18px | 13.5pt | Bold | Normal text | 4.5:1 |
| 18.67px | 14pt | Bold | Large text | 3:1 |
| 20px | 15pt | Regular | Normal text | 4.5:1 |
| 24px | 18pt | Regular | Large text | 3:1 |
| 32px | 24pt | Any | Large text | 3:1 |
Converting points to CSS pixels
Multiply points by 1.333 to get pixels, or multiply pixels by 0.75 to get points. A 16px paragraph is 12pt and normal text; a 24px heading is 18pt and large. The size check in the panel does the conversion and then tells you which pair of thresholds applies at that size.
Thin, condensed and decorative typefaces
Point size alone can flatter a delicate font. The WCAG definition of large scale text warns that fonts with very thin strokes are harder to read at lower contrast, so a hairline display face at 24px deserves the 4.5:1 normal text ratio even though it technically qualifies as large.
Contrast failures showing up across the site?Send the address and the pages that matter most. The free proposal lists which colors fail, where they are used and what Progression would change first.
Get a free proposalTell us about a project you’d like help with.
Non-text contrast for buttons, inputs, icons and charts
Non-text contrast is the 3:1 minimum that SC 1.4.11 sets for the visual parts of controls and graphics people need in order to use a page. It covers the edge that shows an input exists, the tick in a checkbox, a focus ring, a standalone icon and the lines of a chart, each measured against the colors next to it.
Which part of a control has to reach 3:1?
Only the visual information needed to identify the control and its state. Understanding 1.4.11 explains that a button whose text already shows it is a button needs no contrasting border, while a text field with no other cue relies on its border, which then needs 3:1 against the background around it.
| W3C example (Understanding 1.4.11) | Colors | W3C verdict | This checker |
|---|---|---|---|
| Focus indicator around a text button | #949494 on #FFFFFF | Pass, quoted as 3:1 | 3.03:1 |
| Text input border | #767676 on #FFFFFF | Pass | 4.54:1 |
| White input on a dark blue panel | #FFFFFF on #003366 | Pass | 12.61:1 |
| Custom checkbox tick | #E5E5E5 on #6221EA | Pass, quoted as 5.6:1 | 5.70:1 |
| Yellow ring inside a blue button | #FFFF00 on #4189B9 | Pass | 3.55:1 |
| Yellow ring outside the button on white | #FFFF00 on #FFFFFF | Fail | 1.07:1 |
| Green ring outside the button on white | #008000 on #FFFFFF | Pass | 5.14:1 |
| Pale yellow rating stars | #FFF000 on #FFFFFF | Fail, quoted as 1.2:1 | 1.19:1 |
Focus rings and selected states
A focus indicator that sits outside a component has to contrast with the surface the component sits on; one drawn inside has to contrast with the component itself. W3C shows a yellow ring passing inside a blue button and failing outside it on white, which is why the preview in the panel draws an outline and an icon in your colors.
Icons, chart lines and infographics
For graphics, only the parts a reader needs must reach 3:1. W3C describes each meaningful line of a chart as a graphical object, and a single color icon as one object, so pale gridlines can stay pale while the data lines cannot. Our iconography guide covers icon sets in more depth.
- Check icon color against the fill it sits on, not the page behind the fill.
- Give chart series a pattern or label as well as a hue.
- Inactive controls are excluded, but a control that looks inactive and is not still counts.
- Default browser controls the author has not restyled are excluded too.
Links told apart from body text by color alone
When links are marked only by a different color, with no underline, W3C technique G183 asks for at least 3:1 between the link color and the surrounding text color, on top of each meeting its own contrast with the background. The technique supports SC 1.4.1 Use of Color, and an underline removes the need for it.
Can a link pass against the background but fail against the text?
Yes, easily. Illustrative example. A #0000EE link on white scores 9.40:1, comfortably AAA, yet next to #20222B body text it reaches only 1.69:1, so a reader who cannot tell the hues apart cannot find the link. Enter the link color and the text color as the pair to test this.
- Underline inline links and the 3:1 link to text test no longer applies.
- Keep hover and focus styles visibly different from the resting state.
- Test visited link colors as well as the default.
- Our website footer design guide covers link color in dense footer menus.
Building accessible color combinations from a brand palette
Accessible color combinations come from grading every pair in the palette before anyone designs a page, then using only the pairs that pass for each job. The palette check in the panel does this for up to eight colors, rows as text and columns as background, and downloads the matrix as a CSV file.
| Illustrative example. Pair | Ratio | Highest level for normal text | What to do |
|---|---|---|---|
| Navy #223355 on white | 12.55:1 | AAA | Use for body copy |
| Navy #223355 on gold #F4B400 | 6.80:1 | AA | Fine for buttons and banners |
| Navy #223355 on green #00BB77 | 5.01:1 | AA | Fine for buttons |
| White on green #00BB77 | 2.51:1 | Fail | Darken the green to #008857 (4.51:1) |
| White on gold #F4B400 | 1.85:1 | Fail | Put navy text on gold instead |
| Green #00BB77 on pale blue #E8EEF6 | 2.15:1 | Fail | Keep green for fills, not text |
How to read the palette matrix
Each cell shows the ratio and the highest level the pair reaches for normal text: AAA from 7:1, AA from 4.5:1, AA large from 3:1, which is also the non-text minimum, and Fail below that. The ratio is symmetric, so the matrix mirrors across its diagonal, and the summary counts how many pairs clear 4.5:1.
Keeping the brand color and still passing
A failing brand color rarely needs replacing; it usually needs a darker or lighter partner for text. Keep the bright green for large fills and illustrations, and use a deeper shade of the same hue wherever words sit on it. Our color palette guide and triad of colors explainer cover choosing the hues in the first place.
- Name each approved pair in the design system, for example text on surface and text on brand.
- Store the pairs as tokens so developers cannot combine colors that were never tested; our Figma design system guide shows how.
- Grade light and dark themes separately, as the dark mode website design page explains.
- Recheck the matrix whenever a rebranding project adjusts a color.
How the suggested colors are found
The suggestions keep the hue and saturation of your color and move only its HSL lightness, in steps of 0.1, until the pair reaches the target, testing every candidate after it is rounded to a hex code. The checker searches both darker and lighter, offers whichever needs the smaller change, and does this for the text color and the background, at AA and at AAA.
Why keep the hue instead of picking any passing color?
Because the hue carries the brand. Black or white would pass almost anywhere, but a deeper shade of the same blue still reads as your blue. Illustrative example. #777777 on white needs only one step, to #767676, for AA, and a deeper move to #595959 for AAA.
When no shade of a color can pass
Some targets are out of reach. A mid gray such as #777777 sits close to the middle of the luminance scale, so white text on it peaks at 4.48:1 and black text at 4.69:1, and nothing reaches 7:1. The checker says so and suggests changing the other color instead.
- Suggestions are opaque colors, so applying one resets the opacity slider to 100%.
- A suggested hex is retested after rounding, so it always passes the target it was found for.
- Pale text on a dark background moves lighter; dark text on a light one moves darker.
- A suggestion is a starting point; check it against the rest of the palette before adopting it.
Text on photos, gradients and layered backgrounds
Text over an image or gradient has to keep its ratio against the part of the background directly behind each letter, which a single pair of colors can only approximate. W3C technique G18 suggests darkening or fogging the area behind the text, adding a thin outline or a halo, or shading the letters along with the background.
How do I test text placed on a photo?
Test the lightest and the darkest spot the text crosses, using each as the background against your text color. If either fails, add a solid or semi-transparent panel behind the words and test the blended panel color instead; the opacity slider shows the effect.
Placeholder, hover and focus text
Understanding 1.4.3 states that the requirement applies to placeholder text and to text that appears on hover or keyboard focus. Placeholder copy is often styled in a pale gray, so test it like any other label.
- Check text on every slide of a carousel, not only the first.
- Recheck overlays after an image is swapped.
- Give images a text alternative as well; our alt text guide covers how to write it.
- Test text over video at its lightest frame.
Mistakes that make a contrast check wrong
Most wrong contrast results come from testing the wrong colors rather than from the arithmetic. Check these before trusting a pass.
- Sampling a pixel from a screenshot, where anti-aliasing lightens thin text.
- Testing the brand color when the CSS actually applies a tint of it.
- Forgetting the opacity applied to text or to a layer above it.
- Measuring text against the page background instead of the card it sits on.
- Treating a 20px bold heading as normal text or a 20px regular one as large.
- Rounding 4.49:1 up to 4.5:1 in a report.
- Checking only the default state and missing hover, focus and visited colors.
- Grading light mode and assuming dark mode passes too.
- Leaving the background unset so it inherits whatever the user agent shows.
What if the background color was never set?
WCAG assumes white when no background is specified, but W3C failure F24 treats setting a text color without a background color, or the reverse, as a failure, because a reader whose own default colors differ can end up with an unreadable mix. Set both.
Brand palette that will not pass on buttons and links?Share the palette and the brand guide. You receive a free proposal for accessible color combinations that keep the brand recognizable.
Get a free proposalTell us about a project you’d like help with.
WCAG versions, ISO and the DOJ web rule
The contrast thresholds are identical in WCAG 2.0, 2.1 and 2.2. The W3C WCAG 2 overview explains that later versions add success criteria without changing existing ones, that content meeting 2.2 also meets 2.1 and 2.0, and that WCAG 2.2 is approved as ISO/IEC 40500:2025.
Did WCAG 2.2 change any contrast numbers?
No. WCAG 2.2 was published on October 5, 2023 and updated on December 12, 2024, and SC 1.4.3, 1.4.6 and 1.4.11 kept their ratios. The one definition change touching contrast is the 0.04045 threshold, which W3C says has no practical effect.
What the DOJ rule says about state and local government sites
The ADA.gov fact sheet on the Title II web rule names WCAG 2.1 Level AA as the technical standard for state and local governments. An interim final rule published on April 20, 2026 moved compliance to April 26, 2027 for entities of 50,000 people or more, and April 26, 2028 for smaller ones and special district governments.
Conformance covers every success criterion, not contrast alone, and the ADA compliant website design page sets out how Progression audits, remediates and builds sites to WCAG 2.2 AA.
Accessible design and remediation from Progression
Progression designs, builds and repairs websites so that contrast, focus, type and every other WCAG 2.2 AA criterion pass before launch and stay passing afterward. The team grades the palette, sets passing color tokens, fixes the templates and retests each release.
| Accessibility work | Market range (market ranges only) | Typical timing |
|---|---|---|
| Accessibility audit with report and fix list | $2,500 to $10,000 (market ranges only) | 2 to 4 weeks |
| Remediation of an existing site | $5,000 to $40,000 (market ranges only) | 3 to 10 weeks |
| New site built to WCAG 2.2 AA from the start | $15,000 to $60,000 (market ranges only) | 8 to 16 weeks |
| Dark theme added to an existing site, including a contrast audit | $4,000 to $12,000 (market ranges only) | 3 to 5 weeks |
| UX audit and fix list | $3,000 to $8,000 (market ranges only) | 1 to 2 weeks |
| Monitoring, re-testing and support | $200 to $1,500 per month (market ranges only) | Ongoing |
Use the ranges to compare quotes like for like. A Progression proposal is priced for your own site, platform and deadline once the pages have been reviewed.
- The UI and UX design team designs components that pass non-text contrast from the first draft.
- Our website redesign projects rebuild templates around an approved palette.
- The WordPress website design team fixes theme colors at the source rather than page by page.
- Testing runs inside our quality assurance testing gate on every release.
- Brand palettes that pass are part of branding and logo design work.
- Public sector work is covered on the government website design page.
- Health, finance and nonprofit builds: healthcare website design, bank website design and nonprofit website design.
- Conversion work on accessible pages runs through the conversion rate optimization team.
More free tools and design reading
Alongside this contrast checker, Progression keeps free tools and explainers for the rest of a site build, from favicons to image descriptions.
- Make every icon size a site needs with the favicon generator.
- Browse the full free marketing tools collection.
- Read how contrast fits the wider principles of design.
- See what color says in what color represents strength.
- Learn whether a brand can own a color.
- Give layouts room to breathe with negative space in design.
- Compare formats in types of websites.
- Plan app screens with mobile app design and app design examples.
Getting found in search
AI, AEO and what is changing
Paid media and lead generation
Websites and design
Choosing and working with an agency
Software and app development
Website design by industry and type
Web development, platforms and hosting
Social, content and brand
By industry and by situation
This page leaves out a lot: the Progression Method, proprietary and reserved for clients. Reach out to learn more
Frequently asked questions
Is this color contrast checker free to use without an account?
What ratio does WCAG AA set for ordinary paragraph text?
How is a WCAG contrast ratio worked out from two colors?
What does relative luminance mean in WCAG?
Why does a 4.499:1 result fail the 4.5:1 minimum?
What font size qualifies as large text under WCAG?
Is 18px bold text treated as large text?
What does non-text contrast cover on a website?
Do disabled buttons need to meet contrast minimums?
Does text inside a logo need to pass a contrast check?
What separates the AA and AAA contrast levels?
Is 21 to 1 the highest contrast ratio possible?
How does the checker treat semi-transparent text colors?
Which color codes can be typed into the checker?
How are the suggested passing shades worked out?
Why can no text color reach 7:1 on a mid gray background?
How should text over a photograph be tested?
Must placeholder text in form fields pass contrast too?
How much contrast does a colored link need against nearby body text?
Did WCAG 2.2 alter the contrast thresholds from WCAG 2.1?
Which standard and dates apply to public entity websites under the DOJ rule?
Does the 0.04045 versus 0.03928 threshold change any results?
Can I grade a whole brand palette in one go?
Will Progression repair the failing text and button colors on our site?
Contrast failures showing up across the site?Send the address and the pages that matter most. The free proposal lists which colors fail, where they are used and what Progression would change first.
Get a free proposalTell us about a project you’d like help with.
Get a free marketing proposal
Tell us what you are trying to grow and we will come back with a plan, not a pitch deck. Same-day reply on weekdays.
