रंग विपरीतता चेकर

अभिगम्यता के लिए WCAG 2.1 कंट्रास्ट अनुपात का परीक्षण करें।

आपका डेटा आपके डिवाइस से बाहर नहीं जाता
बड़ा टेक्स्ट (24 px बोल्ड)
16 px पर सामान्य टेक्स्ट · सभी अक्षर और अंक यहाँ प्रयुक्त हैं।
-
कंट्रास्ट अनुपात
AA सामान्य
≥ 4.5:1
-
AA बड़ा
≥ 3:1
-
AAA सामान्य
≥ 7:1
-
AAA बड़ा
≥ 4.5:1
-

कैसे उपयोग करें

  1. अग्रभूमि (टेक्स्ट) रंग और पृष्ठभूमि रंग चुनें।
  2. कंट्रास्ट अनुपात तुरंत अपडेट होता है।
  3. सामान्य और बड़े टेक्स्ट के लिए WCAG रेटिंग (AA/AAA) जाँचें।
  4. रंग अदला-बदली करने के लिए Swap पर क्लिक करें।

अक्सर पूछे जाने वाले प्रश्न

WCAG क्या है?

WCAG (Web Content Accessibility Guidelines) वेब सामग्री को सुलभ बनाने के लिए अंतर्राष्ट्रीय मानक हैं। स्तर AA सबसे अधिक आवश्यक मानक है। स्तर AAA उच्चतम है।

«बड़े टेक्स्ट» के रूप में क्या गिना जाता है?

बड़ा टेक्स्ट कम से कम 18 pt (24 px) या 14 pt (18.66 px) बोल्ड के रूप में परिभाषित है। इसकी कंट्रास्ट आवश्यकता कम है क्योंकि इसे पढ़ना आसान है।

कौन सा कंट्रास्ट अनुपात लक्षित करें?

मुख्य टेक्स्ट के लिए, कम से कम 4.5:1 (AA) का लक्ष्य रखें। सर्वोत्तम अभिगम्यता के लिए, 7:1 (AAA) का लक्ष्य रखें। शीर्षक और बड़े टेक्स्ट को कम से कम 3:1 की आवश्यकता होती है।

What WCAG actually measures

"Contrast" in web accessibility is not "how different the colors look", it's a precise ratio of relative luminance between two colors. Luminance is a perceptual approximation of how bright a color appears to a typical sighted observer. The ratio runs from 1:1 (two colors with identical luminance, invisible against each other) to 21:1 (pure black #000000 against pure white #ffffff). Three normative WCAG success criteria use this ratio:

The 4.5:1 floor isn't arbitrary. WCAG's own derivation uses a 3:1 ANSI baseline for normal vision multiplied by 1.5 for users with 20/40 acuity (the threshold often used to define legal "low vision"). 4.5 = 3 × 1.5. The 7:1 AAA threshold extends the same logic to roughly 20/80 acuity. Logos, brand names, and incidental or decorative text are exempt, but everything else falls under the rule.

The formula

The contrast formula in WCAG technique G18 has three steps. Inputs are 8-bit sRGB channel values (0–255), each first converted to a 0–1 range:

  1. Linearise sRGB (undo the gamma curve). For each channel V: if V ≤ 0.04045, V_linear = V ÷ 12.92; otherwise V_linear = ((V + 0.055) ÷ 1.055)^2.4. (Older WCAG documents used 0.03928; the W3C errata-updated to 0.04045 to match the formal sRGB spec, the numerical difference is negligible.)
  2. Compute relative luminance: L = 0.2126·R + 0.7152·G + 0.0722·B (linearised). The weights come from the CIE 1931 standard observer's photopic luminosity function, the human eye is most sensitive to green (~71%), then red (~21%), then blue (~7%). This is why pure blue text on white can fail contrast even though the colors look very different.
  3. Take the ratio: (L1 + 0.05) ÷ (L2 + 0.05), where L1 is the lighter color and L2 is the darker. The 0.05 offset models ambient flare on a typical display, and prevents the ratio from blowing up when one color is near-black.

Worked example for black on white: white has L = 1.0, black has L = 0, so the ratio is (1 + 0.05) ÷ (0 + 0.05) = 21. That's the maximum possible contrast in sRGB.

What counts as "large text"?

WCAG defines large-scale text as at least 18 point (regular weight) or 14 point bold. Converted to CSS pixels at the W3C-stated 1pt = 1.333px:

Most browsers default body text to 16px / 12pt, not large. A common mistake is treating any heading as large; an <h3> styled at 18px regular still falls under the 4.5:1 normal-text rule.

The famous edge case: #767676 on white

Designers chasing minimalism often pick mid-greys for body text. Two values that look identical to the eye are on opposite sides of the WCAG line:

ForegroundBackgroundRatioAA Normal
#000000#ffffff21.00Pass (max)
#595959#ffffff~7.0Pass + AAA
#767676#ffffff4.54Pass (just)
#777777#ffffff4.48Fail
#959595#ffffff3.00Fail (large only)
#ffff00#ffffff1.07Fail

A one-character hex shift, the difference between #767676 and #777777: flips the same-looking grey from passing to failing, because WCAG explicitly forbids rounding ratios up. WebAIM specifically calls out #777777 as a "commonly-used shade of grey" that does not meet AA. This single gotcha drives a measurable share of automated-audit failures in real-world site scans.

Where the formula falls short

The relative-luminance formula is fast and deterministic, but it has well-documented perceptual flaws:

APCA (Accessible Perceptual Contrast Algorithm) is the candidate replacement being prototyped for WCAG 3. It returns a single signed Lc value from roughly −108 to +106, is polarity-aware, and includes a font-weight / size lookup. APCA is currently a beta non-commercial reference, not a legal conformance target (production sites should still target WCAG 2.1 / 2.2 AA) but it's a more accurate readability check, especially for dark mode. Chrome DevTools has an APCA preview built into its color picker.

Why this matters legally

WCAG 2.2 became a W3C Recommendation on 5 October 2023, but the contrast criteria carry forward unchanged from 2.1. Color contrast is one of the most-cited issues in digital accessibility lawsuits, and several jurisdictions effectively make it mandatory:

Color contrast vs color blindness

A common point of confusion: the WCAG ratio is luminance-based and remains useful for most color-blind users, a 4.5:1 ratio derived from luminance corresponds to a strong perceptual signal even when hue cues are lost. That's why the contrast criteria sit alongside a separate criterion, 1.4.1 Use of Color, which forbids relying on color alone to convey information. Contrast doesn't tell you whether a red-vs-green chart is legible to a deuteranope, only whether each color individually contrasts with the chart background. Charts and stateful UI need patterns, labels or shapes layered on top of color.

Practical checklist

More questions

Why does pure yellow on white fail when it looks bright?

Yellow (#ffff00) on white is 1.07:1, almost no contrast at all. The luminance formula weights green at 71% and red at 21%, so yellow (R+G) has a luminance very close to white's. Yellow on black, by contrast, is 19.56:1, one of the most legible combinations known, which is why it's used for road signs and hard-hat warnings.

Should I always target AAA?

No. WCAG itself says: "It is not recommended that Level AAA conformance be required as a general policy for entire sites because it is not possible to satisfy all Level AAA Success Criteria for some content." AA is the legal target almost everywhere; AAA is for high-stakes informational reading (long-form content, government documents intended for the general public, accessibility-first publications).

Can automated tools catch every contrast failure?

No. axe-core, Lighthouse and similar audits flag text-on-flat-color failures reliably, but they cannot test text overlaid on background images, CSS gradients, pseudo-element backgrounds, or CSS border colors, those are flagged "incomplete" and need manual review. A live picker like this one is independently useful for sampling the dominant background color from an image and checking just the text/background pair before shipping.

Does this tool support transparency / alpha?

This page checks opaque hex pairs. If your text or background uses alpha, the actual contrast depends on whatever sits behind it, you'll need to compute the composited foreground first and check the resulting opaque colour.

Does anything get sent to a server?

No. The luminance formula and ratio are computed in your browser; the colors never leave your device. The page works offline once it's loaded.

संबंधित टूल

रंग कनवर्टर मुफ़्त ऑनलाइन कलर पैलेट जनरेटर CSS ग्रेडिएंट जनरेटर