Accessibility Tools contrast WCAG luminance

Color Contrast Checker

Calculate WCAG contrast ratios between foreground and background colors.

Interactive tool

Run the test

Runs in your browser

Normal text sample — The quick brown fox.

Large text sample (18pt / bold).

Computing contrast…

Adjust colors to see WCAG contrast results.

Permission status

Checked in your browser. DeviceHub does not store permission grants.

  • Special permission Not required

Live results

Metrics update as you run the test. Nothing is uploaded.

Loading

Waiting for interactive tool output…

Device information

Labels and capability details reported by your browser.

No device details yet.

Description

About Color Contrast Checker

Introduction

The DeviceHub Color Contrast Checker is a free online WCAG 2.x relative-luminance calculator for sRGB hex foreground and background pairs, without installing design plugins, without crawling your production DOM, and without claiming to replace WAVE, axe DevTools, Lighthouse accessibility scores, or a professional accessibility audit. Product designers verifying brand tokens against AA or AAA thresholds, engineers checking button labels before a release, educators teaching why light gray on white fails, QA capturing a shared ratio for tickets, and content authors confirming call-to-action text all enter two hex colors on one HTTPS page and read an honest contrast ratio grounded in the WCAG relative luminance formula for sRGB. DeviceHub states limits plainly: this tool uses WCAG 2.x relative luminance math for sRGB hex; it is not a full page audit crawler, not a WCAG 3 / APCA certification desk, not a medical or clinical color-vision diagnosis, and not a substitute for Color Blindness Test educational simulations that already live under Display. Pair with Accessibility Preferences when you need prefers-contrast media results from the OS. Pair with Forced Colors Test when Windows High Contrast or forced-colors mode rewrites palettes. Pair with Color Blindness Test for empathy and confusion learning, not clinical screening. Pair with Display Contrast Test when the complaint is panel washout rather than token math. Pair with Accessibility Preferences for a hub view of prefers-* features beside this calculator. Schools bookmark Color Contrast Checker because permissions stay none, no camera, microphone, geolocation, or clipboard prompts merely to compute luminance. Capture the exact hex strings from the failing component; screenshots of a different brand shade waste engineering time. Corporate brand books often list Pantone or CMYK values that must be converted to sRGB before WCAG 2.x web math applies, document that conversion. Translucent overlays, text on photographs, CSS mix-blend-mode, and CSS color(display-p3 …) can pass or fail differently from a flat hex pair; DeviceHub will not invent a crawler pass for those cases. Never treat a single AA pass as proof the entire marketing site is accessible, and never present ratios as clinical acuity scores or fitness-for-duty certificates.

What this tool does

On load, Color Contrast Checker accepts two sRGB hex colors, converts channel values through the WCAG 2.x relative luminance path, computes the contrast ratio between foreground and background, and surfaces guidance against common AA and AAA thresholds for normal and large text so teams can discuss tokens with a shared number. It does not crawl your sitemap, does not inject axe-core into third-party origins, does not rate non-text UI components automatically, and does not upload brand palettes to DeviceHub for advertising when you merely use the page. Guidance separates hex-pair math from live CSS computed styles that include alpha, gradients, and images. Side notes point to Color Blindness Test when the question is educational simulation of confusion pairs, not a clinical diagnosis, and to Contrast Test when ambient light or monitor calibration makes mid-gray hard to read regardless of token ratios. Permissions remain none in DeviceHub’s typed PermissionKind union. Refresh after changing design tokens in Figma exports so the hex you paste still matches production CSS variables. The UI never claims APCA or WCAG 3 conformance certificates from a two-color form. When a pair fails AA, document size, weight, and whether the control is icon-only so engineers do not “fix” the wrong threshold. Closing the tab clears the session; screenshots you take remain your files. Notes remind support staff that mobile OLED night modes and True Tone can change appearance without changing the hex math DeviceHub reports, label results as WCAG 2.x sRGB pair ratios, not photographed appearance under auto-brightness.

When to use it

Run Color Contrast Checker when adopting a new brand palette, when a stakeholder asks whether gray-on-gray buttons meet AA, when converting Figma tokens into CSS custom properties, when filing bugs that need a numeric ratio instead of “hard to read,” when teaching WCAG 2.x luminance in design courses, and when comparing light and dark theme pairs before launch. Prefer Accessibility Preferences when the user report is “my OS wants more contrast” rather than a specific hex pair. Prefer Forced Colors Test when High Contrast mode strips brand colors entirely. Prefer Color Blindness Test for educational empathy about confusion, not medical diagnosis or workplace forms. Prefer Display Contrast Test when the panel itself looks washed out under bright office lights. Prefer Accessibility Preferences for a single overview of prefers-* media beside contrast math. Avoid treating a calculator pass as a WAVE/axe replacement for heading structure, keyboard order, or ARIA. Avoid pasting Display P3 CSS without converting to sRGB first. Retest after marketing swaps hero image backgrounds under text. Use in design-system PR checklists beside screenshots of the live component. Use when legal or compliance asks for a documented method, and still schedule a professional audit for production sites.

How it works

WCAG 2.x defines relative luminance for sRGB by linearizing 8-bit channels and combining them with standard coefficients, then forming a contrast ratio between the lighter and darker luminance values. DeviceHub applies that math to the hex pair you provide and maps the ratio to familiar AA/AAA cutoffs for text. It does not evaluate CSS currentColor inheritance trees, does not sample pixels from a canvas screenshot of your site, and does not certify PDF or native app contrast. Typed permissions stay none, reading two hex strings needs no camera or microphone category. Secure HTTPS hosts the calculator consistently. Browser color management can make the swatch preview look slightly different from a calibrated reference monitor; the numeric ratio still follows the WCAG sRGB formula on the entered channels. Large-text exceptions depend on CSS pixel size and weight in the real UI, DeviceHub’s guidance is informational, not a substitute for measuring the shipped type style. Non-text contrast (UI components, graphics) uses related but distinct WCAG success criteria; do not assume a text AA pass covers icon strokes. Color Blindness Test remains under Display for simulation and must never be framed as clinical screening here. Professional tools such as WAVE and axe evaluate structure, names, and roles this checker cannot see. No DeviceHub server needs your brand hex values to compute a local ratio, processing stays in-page. Fingerprinting via two public brand colors is negligible; still avoid pasting unpublished campaign hexes into public tickets if secrecy matters. Compared with prefers-contrast media queries elsewhere in this suite, hex math is author-controlled while OS contrast preferences reflect user settings, keep those jobs separate in tickets.

Step-by-step instructions

  1. Open Color Contrast Checker over HTTPS and confirm you have the production or design-token sRGB hex values, not a phone photo of a billboard.
  2. Enter foreground (text or icon) and background colors; adjust until the preview matches the intended pairing.
  3. Read the contrast ratio and which WCAG 2.x level applies for the text size class you actually ship.
  4. If OS high-contrast or preference media matters, continue to Forced Colors Test, Accessibility Preferences.
  5. For educational color-vision simulation, not clinical diagnosis, open Color Blindness Test; for panel washout open Display Contrast Test.
  6. Paste results labeled as WCAG 2.x sRGB pair math, not a full site audit and not a medical finding, and schedule WAVE/axe or professional review for page-level conformance.

Common problems

Assuming a hex-pair pass means the whole page passes WAVE or axe. Using Display P3 or wide-gamut CSS without sRGB conversion. Ignoring alpha and text-on-image failures. Treating large-text thresholds as a free pass for tiny captions. Confusing Color Blindness Test educational results with clinical diagnosis. Blaming DeviceHub when True Tone changes appearance but hex math is unchanged. Expecting the tool to crawl multi-page marketing sites. Filing workplace vision forms from contrast ratios. Mixing Display Contrast Test panel issues into token bugs without separating causes. Forgetting dark-theme pairs need their own checks. Claiming AAA everywhere when only AA was required. Replacing professional audits with a calculator screenshot. Pasting competitor brand colors into public forums unnecessarily. Ignoring non-text UI contrast criteria. Using the preview swatch under extreme monitor calibration as “proof” the math is wrong.

Privacy explanation

Color Contrast Checker computes ratios from colors you enter and displays results locally. DeviceHub does not upload brand palettes for advertising when you use this page. Permissions stay none, no microphone, camera, MIDI, clipboard, or geolocation prompts for luminance math. Closing the tab ends the session; nothing keeps sampling your design system in the background. Screenshots of ratios are your choice, avoid posting unpublished campaign hexes if secrecy matters. Classroom demos should clear the form before the next student if proprietary tokens are on screen. Combined with Accessibility Preferences readouts, contrast math does not create a medical record, DeviceHub tools are informational, not clinical. No health data is inferred from hex pairs.

Runtime principles

Built for the browser

What happens when you run this test — without downloads or accounts.

  1. 01

    Runs in your browser

    Color Contrast Checker uses standard web APIs — no install, extension, or desktop app required.

  2. 02

    Reads what the browser allows

    Results come from events and capability signals the web platform exposes for this session.

  3. 03

    Private by default

    Input and diagnostic values stay in your browser session for display — nothing is sold as media.

Compatibility

Supported browsers

Expected support for modern engines. Individual APIs may still vary by device.

  • Chrome

    supported

    Latest stable

  • Firefox

    supported

    Latest stable

  • Safari

    supported

    Latest stable

  • Edge

    supported

    Latest stable

Devices

Supported devices

Hardware and form factors this browser test is designed to exercise.

  • Any modern browser

    Color and contrast patterns render as ordinary web content.

  • Desktop & mobile screens

    Full-viewport patterns work across devices.

  • Assistive tech users

    Tools remain keyboard reachable and labeled.

Privacy

Your data stays with you

Color Contrast Checker is built privacy-first. Diagnostics run in your browser session whenever web APIs allow.

Read our privacy policy

Troubleshooting

Common problems

Quick fixes before you dig into FAQs.

Ratio looks wrong for a brand color
Confirm both values are sRGB hex (not Display P3 or Lab). Soft-proofing and HDR panels can make on-screen appearance differ from WCAG 2.x relative-luminance math on the hex pair alone.
AA passes but the live site still fails
This checker evaluates the two colors you enter, not CSS overlays, images, translucency, or text on gradients. Run a full page audit with WAVE, axe, or a professional review for sitewide issues.
Large-text thresholds confuse me
WCAG large-text rules use size and weight criteria. Apply the threshold that matches your real UI type, then still verify focus and non-text contrast separately.

FAQ

Frequently asked questions

Structured answers for users and FAQ rich results.

Browse FAQs
Is this a medical or clinical color-vision test?
No. DeviceHub accessibility tools are informational only, not medical or clinical diagnoses. For educational color-vision simulation, see Color Blindness Test under Display (also not clinical).
Does a passing ratio mean my whole site is accessible?
No. This checker uses WCAG 2.x relative luminance math for sRGB hex pairs you enter. It is not a full page audit crawler and does not replace WAVE, axe, or a professional audit.
Why might the preview disagree with my monitor?
Soft-proofing, True Tone, HDR, and calibration change appearance. The numeric ratio still follows WCAG 2.x sRGB math on the hex channels you entered.
Do I need any permission?
No. Permissions stay none, contrast math does not require camera, microphone, or clipboard access.
What about text on images or translucent overlays?
Those cases need pixel or computed-style audits beyond a flat hex pair. Use professional tools for live-page failures.
Which related tools should I open next?
Accessibility Preferences and Forced Colors Test for OS settings, Color Blindness Test for non-clinical education, and Display Contrast Test for panel washout.

Newsletter

Updates coming soon

A lightweight email digest for new tools and release notes is planned. No signup form is live yet — check Release Notes for product updates.

Release notes

Need another diagnostic after Color Contrast Checker?

Explore related DeviceHub tools that pair well with this test.