A color contrast checker tells you whether text is actually readable against its background — measured objectively, not just eyeballed — by calculating a precise contrast ratio and comparing it against the WCAG accessibility standards used by designers, developers, and legal accessibility audits worldwide. This tool computes that ratio in real time from any two colors you choose, shows a live text preview so you can see the pairing exactly as a visitor would, and flags pass/fail results for every WCAG conformance level: AA and AAA, for both normal and large text.
Low-contrast text is one of the most common accessibility failures on the web, and one of the fastest to fix once you can see the exact ratio in front of you instead of guessing.
What This Color Contrast Checker Does
Pick a foreground (text) color and a background color using either the color picker or by typing a HEX code directly. The tool immediately calculates the relative luminance of each color, derives the contrast ratio between them, and displays four pass/fail badges covering the WCAG 2.1 thresholds for normal text and large text at both the AA and AAA conformance levels. The live preview box below shows real sample text — one large heading-style line and one normal-size paragraph line — rendered in your exact colors, so you can judge readability visually alongside the numeric ratio.
The tool also gives you a ready-to-copy CSS snippet with your chosen color and background-color values, so once you've found a pairing that passes, you can drop it straight into your stylesheet.
How to Use the Color Contrast Checker
- Set your text color. Use the color picker or type a HEX code into the foreground field.
- Set your background color. Do the same for the background field — this is usually the surface the text sits on: a card, button, page background, or banner.
- Read the contrast ratio. The large number shown is the exact ratio between your two colors, expressed as X:1.
- Check the pass/fail badges. Green means that combination meets the standard; red means it falls short and should be adjusted.
- Look at the live preview. Confirm visually that both the large and normal-size sample text are comfortably legible.
- Copy the CSS. Once you're satisfied, copy the generated color declarations directly into your code.
How Contrast Ratio Is Calculated
Contrast ratio is derived from the relative luminance of each color — a measure of how bright a color appears to the human eye, weighted by how sensitive our vision is to red, green and blue light respectively. As the W3C's WCAG 2.1 contrast guideline defines it, relative luminance is computed by converting each sRGB channel (red, green, blue) into a linear value, weighting them (roughly 21.26% red, 71.52% green, 7.22% blue — reflecting the eye's greater sensitivity to green), and summing the result.
The contrast ratio between two colors is then (L1 + 0.05) / (L2 + 0.05), where L1 is the luminance of the lighter color and L2 the luminance of the darker one. The result ranges from 1:1 (identical colors, zero contrast) to 21:1 (pure black on pure white, maximum possible contrast).
MDN's colour contrast guide lists the same thresholds this tool tests: 4.5:1 (AA) and 7:1 (AAA) for body text, 3:1 (AA) and 4.5:1 (AAA) for large text, and 3:1 for active UI components and graphical objects. The formula here is the WCAG relative-luminance formula above, so the ratio should agree with other WCAG-based checkers to two decimal places.
WCAG AA vs. AAA — What the Thresholds Mean
WCAG 2.1 defines two conformance levels most teams care about, each with separate thresholds for normal text and large text:
- AA Normal Text — minimum 4.5:1. This is the baseline legal and professional standard for regular body text (below 18pt, or below 14pt bold). Most accessibility audits, government requirements (like Section 508 in the US), and mainstream design systems target this level as the floor.
- AA Large Text — minimum 3:1. Large text (18pt/24px and above, or 14pt/18.66px and above when bold) is easier to read even at lower contrast, so the WCAG threshold is relaxed for headings and large UI labels.
- AAA Normal Text — minimum 7:1. A stricter, "enhanced" standard recommended for content aimed at users with low vision, or for organizations targeting the highest accessibility bar.
- AAA Large Text — minimum 4.5:1. The enhanced threshold for large text, still more forgiving than AA normal text.
Most production websites target AA as the practical minimum across all text, since it is the level most accessibility policies adopt. The ADA's web guidance points to WCAG and the Section 508 Standards as technical references without naming a level, so check which level your own contract or jurisdiction requires. AAA is a stretch goal, often applied selectively to primary content rather than every UI element, since it can be difficult to satisfy while still using a full, expressive color palette.
Fixing a Failing Color Pair
When a combination fails, the fix is almost always to increase the lightness gap between the two colors rather than changing hue. A few practical approaches: darken the text color, lighten the background, or do both slightly rather than one drastically — this usually preserves brand color intent better than an extreme single-side change.
If the failing pair involves a brand color used as the text color on a light background, consider using that brand color only for large headings (which need less contrast) and switching to a darker neutral for body copy. Conversely, if a brand color is used as a background behind white text, a slightly darker shade of that same brand color often clears AA while staying visually on-brand.
Contrast for Non-Text Elements
Text contrast gets the most attention, but WCAG 2.1's non-text contrast criterion also requires a minimum 3:1 ratio for meaningful graphical elements and interactive component boundaries — think button outlines, form field borders, icons that convey information, and focus indicators. This tool's foreground/background inputs work equally well for checking those pairings; just treat the "foreground" color as the border, icon, or outline color instead of body text.
Accessible contrast is one small piece of a technically sound website. Arb Digital builds fast, standards-compliant sites and can audit an existing one for accessibility, performance and search visibility together.
See Technical SEO Services All Free ToolsHow to Read the Result
With the default colours, navy #1B3A6B on white #FFFFFF gives 11.27:1 and all four badges pass. Gold #E8A020 on white gives 2.22:1 and fails all four, so gold text on white is unreadable at any size. Put gold on the navy instead and the ratio is 5.09:1, which passes AA for normal text but not AAA. Black text on that gold gives 9.48:1.
Edge cases show why you read the badges and not just the number. #777777 on white is 4.48:1: close to 4.5, but it fails AA normal text and passes only AA large text. #767676 on white is 4.54:1, the lightest plain grey that passes AA normal text on white. The ratio is shown to two decimals, but the badges compare the unrounded value, so a pair displayed as 4.50:1 can still fail.
Inputs: three-digit shorthand (#abc is read as #aabbcc) or six-digit HEX, with or without the #. Colours with transparency are not read. If either box holds something that is not a valid HEX code, its border turns red and the result area shows “Invalid HEX” instead of an old ratio.
What to Do Next
- Fails AA normal but passes AA large: keep the colour for large headings (24px, or 18.66px bold, and up) and use a darker or lighter neutral for body copy.
- Fails everything: move one colour at a time along lightness until the badges turn green, then convert the result with the HEX to RGB converter if your code needs another format.
- Passes AA, fails AAA: usually fine. Aim for AAA on long-form reading text or if a policy asks for it.
- Check every state: repeat the test for hover, focus, disabled and placeholder text. Text over images or gradients has no single background colour, so this tool cannot measure it.
Thresholds used: AA normal 4.5, AA large 3, AAA normal 7, AAA large 4.5. Nothing else is assumed. For icons and borders, read the AA Large badge, which is the same 3:1 as the non-text rule.
Common Mistakes to Avoid
- Judging contrast by eye alone. Two similarly-saturated colors can look distinct on a bright monitor yet fail the actual ratio test — always verify with a calculator, not intuition.
- Testing brand colors only at full opacity. A text color with reduced opacity effectively blends with the background and lowers the real contrast ratio below what the solid HEX value would suggest.
- Ignoring placeholder and disabled-state text. Faint gray placeholder text is one of the most common contrast failures on the web — check it explicitly, not just primary body copy.
- Assuming large text rules apply to bold body copy. The large-text threshold only kicks in at 18pt regular or 14pt (18.66px) bold specifically — a slightly bold 12px label still needs to meet the normal-text ratio.
- Only checking the darkest/lightest brand shades. Mid-tone brand colors used as backgrounds behind white or black text are the most common source of contrast failures — test every real pairing used in the interface, not just the extremes.
Related Free Tools From Arb Digital
Once you've found a passing color pair, convert it to whatever format your codebase needs with the HEX to RGB converter or RGB to HEX converter. Apply your finalized colors to backgrounds and buttons using the CSS gradient generator or add depth with the box shadow generator, and shape your layout with the CSS grid generator. Browse every free utility at our free online tools hub.
Frequently Asked Questions
For normal body text, aim for at least 4.5:1 to meet WCAG AA — the widely accepted minimum standard. For large text (18pt+ or bold 14pt+), 3:1 is sufficient for AA. For the stricter AAA level, target 7:1 for normal text and 4.5:1 for large text.
The ratio is derived from each color's relative luminance — a weighted brightness value calculated from its red, green and blue channels per the WCAG 2.1 formula. The contrast ratio is then (L1 + 0.05) divided by (L2 + 0.05), where L1 is the lighter color's luminance and L2 the darker one's, producing a value from 1:1 up to 21:1.
Large text is defined as 18pt (24px) or larger for regular weight, or 14pt (about 18.66px) or larger when bold. Large text gets a relaxed contrast requirement — 3:1 for AA instead of 4.5:1 — because bigger characters remain legible at lower contrast than small text.
AA is the standard most legal and organizational accessibility requirements reference, and it is the practical target for the vast majority of websites. AAA is a stricter, optional enhancement usually reserved for content specifically serving users with low vision, since it can be hard to satisfy across an entire expressive color palette.
Yes. While the preview box shows text, the underlying calculation works for any two colors — use the foreground field for a button border, icon, or outline color and the background field for the surface behind it to check against the 3:1 non-text contrast criterion.
Yes — completely free, with no sign-up and no limit on how many color pairs you check. All calculations run locally in your browser using the standard WCAG 2.1 formula, and nothing you enter is stored or transmitted anywhere.
WCAG sets 4.5:1 as a hard minimum, with no rounding. A pair at 4.48:1 (for example #777777 on white) is below it and fails AA for normal text, while #767676 on white reaches 4.54:1 and passes.
This tool runs entirely in your browser — nothing you enter is uploaded or stored.