WCAG Contrast Checker

Share:
Developer Tools

WCAG Contrast Checker

WCAG 2.1 AA/AAA accessibility

By Checked against sources by Last reviewed ACCESSIBILITY DESIGN DEV WCAG
Your browser is too old for this tool’s interactive features. Please update to Safari 13.1, Chrome or Edge 80, Firefox 74 or newer.

WCAG Contrast Checker

Type HEX (3, 6 or 8 digits), rgb() or hsl(). Text with transparency is graded as it shows on the background.

The quick brown fox jumps over the lazy dog.

Normal text — 16px regular body copy

Large heading text

Large text — about 24px regular, or about 18.5px bold
Contrast ratio (WCAG 2.2)
—
Relative luminance — text: — · background: —
AA Normal (4.5:1)
—
AA Large (3:1)
—
AAA Normal (7:1)
—
AAA Large (4.5:1)
—
UI Components (3:1)
—
Enter a text colour and a background.

Nearest colours that pass

Same hue and saturation, lightness moved only as far as it has to.

Change the text colour
—
Change the background
—
📅 Research current as of 05 Nov 2026 · Sources: WCAG 2.2 (W3C Recommendation, 12 December 2024) for the relative-luminance definition and success criteria 1.4.3, 1.4.6 and 1.4.11; Understanding Contrast (Minimum) for the 3 × 1.5 derivation of 4.5:1 and the pt-to-px conversion; the sRGB specification, from which WCAG takes the 0.2126/0.7152/0.0722 weights
Standards, published formulas, and reference data are revised over time — check against a current authoritative source before relying on these figures.
Advertisement
After results · AD-W1Responsive · Post-tool — peak engagement

How to use the WCAG Contrast Checker

Enter your text and background colours

Use the colour pickers, or type a value: HEX in 3, 6 or 8 digits, rgb() or hsl(), or paste a whole declaration such as color: #333;. If the text colour has transparency (#00000080, rgba(0, 0, 0, 0.5)), the checker grades the colour you would actually see, blended onto the background — 50% black on white shows as #808080 and scores 3.95:1, not the 21:1 of solid black. The background has to be solid, because what shows through a transparent one depends on whatever is behind it. A useful reference point: #222 on #FFF computes to 15.91:1. The values the page loads with are this site's own body text, #1a1814 on #f7f6f3, which comes to 16.40:1.

Read the contrast ratio and verdict cards

The big number is the contrast ratio from WCAG's relative-luminance definition, unchanged from WCAG 2.0 through 2.2. The five verdict cards are the thresholds the guidelines actually set: AA Normal 4.5:1 (SC 1.4.3), AA Large 3:1 (the same criterion's large-text exception), AAA Normal 7:1 and AAA Large 4.5:1 (SC 1.4.6 Contrast (Enhanced)), and UI Components 3:1 (SC 1.4.11 Non-text Contrast, which covers controls and meaningful graphics rather than text). "Large" has a definition rather than a feel — see step 4. The verdicts use the unrounded ratio, as WCAG asks: #006BFB on black is 4.4961:1, so it is printed as 4.496 and fails AA, rather than rounded to a "4.50" that looks like a pass.

Verify with the live preview

The two preview boxes render real text in your colours, one at body size and one at heading size. Use them as a sanity check on the number rather than as the verdict: the ratio is a luminance calculation and knows nothing about stroke weight, and WCAG says so — fonts with extraordinarily thin strokes or unusual features are harder to read, especially at lower contrast levels. A hairline typeface at 4.6:1 is a worse choice than the number suggests.

Check whether your text is actually "large"

The 3:1 relaxation applies only to large scale (text), which WCAG 2.2 defines as at least 18 point or 14 point bold or font size that would yield equivalent size for Chinese, Japanese and Korean (CJK) fonts. The Understanding document converts that with 1pt = 1.333px, making 14pt and 18pt equivalent to approximately 18.5px and 24px. A 22px heading is not large text, whatever it looks like, and needs the full 4.5:1. Note also what the size is measured on: WCAG says font size is the size when the content is delivered and excludes any resizing the user applies afterwards.

If it fails, take the nearest colour that passes

Pick the ratio you need — 3:1, 4.5:1 or 7:1 — and the checker shows the closest text colour and the closest background that reach it, keeping the hue and saturation and moving only the lightness, in either direction, as little as it has to. On white, #777777 (4.48:1) becomes #767676 (4.54:1). Press the button under a suggestion to try it. When nothing of that hue can reach the target, it says so and names the best any colour manages on that background. On a mid-grey such as #777, not even black or white reaches 7:1.

Advertisement
After how-to · AD-W2Responsive

Color contrast — the math behind accessibility

WCAG 2.2 — W3C Recommendation, 12 December 2024 — defines relative luminance for the sRGB colour space as L = 0.2126·R + 0.7152·G + 0.0722·B, where each channel is first divided by 255 and then linearised: c/12.92 below the threshold, ((c+0.055)/1.055)^2.4 above it. The contrast ratio is (L1 + 0.05) / (L2 + 0.05) with the lighter colour on top. Those three weights are not a WCAG invention — the guidelines note the formula is taken from [SRGB], the sRGB specification — and they are why a saturated green reads far brighter than a saturated blue of the same nominal intensity. The 0.05 is a fixed flare term; it is what caps the scale at 21:1, since pure white over pure black is (1.00 + 0.05) / (0.00 + 0.05).

This checker uses the current threshold, 0.04045. WCAG notes that before May 2021 the definition printed 0.03928 and that the change has no practical effect on the calculations; for 8-bit colours it has none at all, since 10/255 is 0.0392 and 11/255 is 0.0431, and no channel value falls between the two constants. Ratios are compared with the thresholds unrounded, because the Understanding document says the computed values should not be rounded and gives 4.499:1 as a ratio that does not meet 4.5:1.

Because the ratio is built from luminance alone, it is deliberately blind to hue. The Understanding document explains why that is the right design rather than a shortcut: for people with color vision deficiency who are not able to distinguish certain shades of color, hue and saturation have minimal or no effect on legibility as assessed by reading performance, and light-dark perception is unaffected. One documented exception — the use of predominantly long wavelength colors against darker colors (generally appearing black) for those who have protanopia, which is why red on black carries its own advisory technique. A passing ratio is not a promise that a red-on-black pairing will read.

Where 4.5:1 and 7:1 come from

They are derived, and the derivation is published. The Understanding document for SC 1.4.3 starts from adoption of the 3:1 contrast ratio for minimum acceptable contrast for normal observers, in the ANSI standard, then applies an empirical result: in the population, visual acuity of 20/40 is associated with a contrast sensitivity loss of roughly 1.5. Multiply: 3 × 1.5 = 4.5:1. Repeat the logic for 20/80 acuity and you get the 7:1 of SC 1.4.6.

It is worth being accurate about who that describes, because this page previously was not. WCAG says 20/40 is commonly reported as typical visual acuity of elders at roughly age 80 — not of most adults over 50. The thresholds compensate for the loss in contrast that results from moderately low visual acuity, congenital or acquired color deficiencies, or the loss of contrast sensitivity that typically accompanies aging, taken together. There is no claim, in WCAG or here, that sub-4.5:1 text measurably slows readers with unimpaired vision.

Contrast is one criterion, not the whole of colour accessibility

This page answers SC 1.4.3 and 1.4.6 for a pair of solid colours, and SC 1.4.11 for a control. It cannot answer SC 1.4.1 Use of Colour, which is a separate requirement that colour not be the only visual means of conveying information — an error state that is red and nothing else fails 1.4.1 at any contrast ratio. Nor does it know what the colours are for: WCAG exempts text that is part of a logo or brand name and text that is pure decoration or part of an inactive user interface component from the contrast requirement entirely. The ratio is the same number; whether it has to clear a threshold is a judgement about the content, and it stays yours.

Frequently Asked Questions

  • They are two separate success criteria with different derivations, not two strictnesses of one rule. AA is SC 1.4.3 Contrast (Minimum) at 4.5:1 for body text and 3:1 for large text, derived from 20/40 acuity. AAA is SC 1.4.6 Contrast (Enhanced) at 7:1 and 4.5:1, derived the same way from 20/80. W3C's own guidance on conformance is that AAA is not proposed as a whole-site requirement, because for some content it cannot be met — so treat AAA as a target for specific surfaces (long-form reading, error and legal text) rather than a site-wide grade.

  • WCAG 2.2 defines large scale (text) as at least 18 point or 14 point bold or font size that would yield equivalent size for Chinese, Japanese and Korean (CJK) fonts. Points, not pixels — the Understanding document supplies the conversion at 1pt = 1.333px and calls 14pt and 18pt equivalent to approximately 18.5px and 24px. Two details people miss. The size is the size when the content is delivered, so a user zooming in does not make your text large. And the definition is normative for the exception only: a 22px semibold heading is normal text and needs 4.5:1, however large it looks next to the body copy.

  • It is 3 × 1.5, and both factors are named in the Understanding document. The 3 is the 3:1 contrast ratio for minimum acceptable contrast for normal observers, in the ANSI standard. The 1.5 is the empirical finding that in the population, visual acuity of 20/40 is associated with a contrast sensitivity loss of roughly 1.5 — so a user with 20/40 would thus require a contrast ratio of 3 * 1.5 = 4.5 to 1. The same construction at 20/80 acuity produces the 7:1 of SC 1.4.6. Who is 20/40? WCAG's own answer: it is commonly reported as typical visual acuity of elders at roughly age 80. It is not, as this page used to say, most adults over 50 — and there is no WCAG claim that text below 4.5:1 measurably slows readers with unimpaired vision.

  • Different criteria apply, so the same 3:1 card can mean different things. SC 1.4.11 Non-text Contrast requires 3:1 against adjacent colour for the visual information needed to identify user-interface components and states, and for the parts of a graphic required to understand the content — a chart's data series qualifies, a decorative flourish does not. SC 1.4.3 exempts logos outright: text that is part of a logo or brand name has no contrast requirement, though the Understanding document warns that this becomes problematic when logos or logotypes act as user interface components, such as a home link. For charts specifically, note that contrast does not discharge SC 1.4.1: a legend distinguished only by colour fails regardless of the ratios. The checker computes any two-colour pair; deciding which criterion the pair falls under is a judgement about the content.

  • They measure different things and are not interchangeable. The WCAG ratio arrived with WCAG 2.0 in 2008 and is unchanged through WCAG 2.2 (Recommendation, 12 December 2024): relative luminance, a fixed 0.05 flare term, a symmetric ratio. Because it is symmetric, it gives the same answer whether your text is light on dark or dark on light — a known limitation, since the two are not equally readable in practice. APCA reports a polarity-aware lightness contrast (Lc) instead, and was developed outside WCAG 2.x. WCAG 3.0 is still a Working Draft (the current one is dated 10 September 2026): it is not a Recommendation, nothing is required to conform to it, and while it lists a Text contrast sufficient requirement, it does not name APCA or settle a method. This page computes the WCAG 2.x ratio, which is what every current conformance claim is written against.

  • Keep the hue and change the lightness: that is what the "Nearest colours that pass" panel computes, for the text colour and for the background, so you can see how far a brand colour has to move. This site's own accent, #E8622A, is 3.38:1 on white; the nearest colour of the same hue and saturation that reaches 4.5:1 there is #CD4C16, at 4.52:1. Other common answers: keep the brand colour for large text, icons and accents and set body text in a neutral; or put dark text on a light brand colour and white text on a dark one. Using the brand colour "for headings only" works only if the headings are large text in WCAG's sense — at least about 24px, or about 18.5px bold. A 20px heading needs the full 4.5:1.

  • No, and WCAG itself says why. Colour alone still fails separately. SC 1.4.1 Use of Colour is a distinct criterion that a perfect ratio does not satisfy. One hue is a known exception — the Understanding document singles out long-wavelength colours against near-black for readers with protanopia, and gives red-on-black its own advisory technique. The maths ignores the typeface: WCAG notes that fonts with extraordinarily thin strokes or unusual features are harder to read especially at lower contrast levels. And the ratio is symmetric, so it cannot tell you that light-on-dark and dark-on-light at the same score read differently. Treat the number as a floor that can be checked automatically, not as an account of legibility.

  • The requirement is per-point, which is what makes it hard: SC 1.4.3 asks for a ratio between the text and its background, and a varying background has no single value to test — so the criterion has to hold at the worst point the glyphs actually touch, not at an average. For dark text that is the lightest region; for light text, the darkest. The only exemption nearby is narrow: text that is part of a picture that contains significant other visual content has no contrast requirement, which covers a photograph with incidental writing in it, not your hero headline. Practical fixes are to put a solid or semi-transparent scrim between image and text, or to give the text its own filled container — both convert a varying background into a measurable one. A text-shadow can help perceptually but gives you nothing to paste into this tool.

  • No. The ratio, the verdicts and the suggestions are computed by the script on this page, in your browser. The colours you type are not sent anywhere, not saved, and not written into the address bar. The page itself still makes ordinary requests — its scripts and styles, advertising, and analytics if you allow it — and none of them carries the colours you enter.

Method & sources

How it computes

WCAG 2.2 contrast ratio (L1 + 0.05) / (L2 + 0.05) over relative luminance L = 0.2126R + 0.7152G + 0.0722B, channels linearised with the 0.04045 threshold. Translucent text is composited onto the background first. Verdicts on the unrounded ratio: SC 1.4.3 4.5:1 / large 3:1, SC 1.4.6 7:1 / 4.5:1, SC 1.4.11 3:1. Nearest passing colour keeps hue and saturation and moves lightness.

What this tool implements

  • Relative luminance and contrast ratio exactly as WCAG 2.2 defines them, with the 0.04045 threshold. WCAG's Note 2 says the pre-May-2021 value was 0.03928 and that the change has no practical effect; for 8-bit colours it has none, since 10/255 = 0.0392 and 11/255 = 0.0431 and no channel value falls between. The page used 0.03928 until 2026-11-05.
  • Verdicts compare the UNROUNDED ratio with each threshold, per Understanding SC 1.4.3 ("the computed values should not be rounded"). The printed ratio uses two decimals unless that would land on a threshold the ratio misses, then more (#006BFB on black prints 4.496, not 4.50).
  • The five verdicts are three criteria: AA Normal 4.5:1 and AA Large 3:1 (SC 1.4.3), AAA Normal 7:1 and AAA Large 4.5:1 (SC 1.4.6), UI Components 3:1 (SC 1.4.11). Large scale text is at least 18pt or 14pt bold, which Understanding SC 1.4.3 converts to approximately 24px and 18.5px.
  • Input is any CSS colour the site's shared colour code reads: HEX in 3, 4, 6 or 8 digits, rgb()/rgba(), hsl()/hsla(), also pasted as a declaration. Translucent text is composited source-over onto the background (a·c + (1 − a)·b per channel, rounded to a byte) and graded on that; a translucent background is refused, because what shows through it is unknown.
  • Nearest passing colour: the moving colour's CSS Color 4 HSL hue and saturation are kept and its lightness walked in 0.1-point steps each way to the first byte-rounded colour that reaches the target on the unrounded ratio; the smaller change is offered. When neither end reaches it, the page says so and gives the most black or white can reach on that background.
  • APCA and WCAG 3.0 are described as what they are: WCAG 3.0 is a Working Draft (10 September 2026) whose text-contrast method is not settled and which does not name APCA.

Sources

  • W3C. Web Content Accessibility Guidelines (WCAG) 2.2, W3C Recommendation 12 December 2024 — relative luminance (Note 2 on 0.03928), contrast ratio, large scale (text), SC 1.4.3, 1.4.6, 1.4.11: https://www.w3.org/TR/WCAG22/
  • W3C WAI. Understanding SC 1.4.3 Contrast (Minimum) — the 3 × 1.5 derivation, 20/40 and 20/80 acuity, 1pt = 1.333px, "the computed values should not be rounded", the logo and protanopia notes: https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html
  • W3C WAI. Understanding SC 1.4.11 Non-text Contrast — 3:1 against adjacent colours for user-interface components and graphical objects: https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html
  • W3C. CSS Color Module Level 4, Candidate Recommendation Draft 3 November 2026 — §7.1 and §7.2 HSL conversion used for the nearest passing colour: https://www.w3.org/TR/css-color-4/
  • W3C. WCAG 3.0, W3C Working Draft 10 September 2026: https://www.w3.org/TR/wcag-3.0/
  • IEC 61966-2-1:1999. Multimedia systems and equipment — Colour measurement and management — Part 2-1: Default RGB colour space — sRGB, the source WCAG cites for the luminance formula: https://webstore.iec.ch/en/publication/6169
  • Arditi A, Faye E. Monocular and binocular letter contrast sensitivity and letter acuity in a diverse ophthalmologic practice. Optometry and Vision Science 2004;81(12s):287 — the [ARDITI-FAYE] reference behind the 1.5 contrast-sensitivity factor.

What can make this go out of date

  • None at runtime. Both colours are typed or picked by the reader and every figure is computed in the browser; nothing is sent or put in the URL.

Embed this tool

Put the WCAG Contrast Checker on your own site — free, no signup

Paste this where you want the tool to appear. It loads from recatools.com, works on any site, sets no cookies, and shows no ads. Please keep the credit line — it is the only thing we ask for.

Advertisement
Pre-footer · AD-W3 728 × 90