Skip to developer tool
DEVELOPER TOOLKIT CSS & COLOR

WCAG Color Contrast Checker

Check a pair of solid colors before using them for text, icons or controls. Compare AA and AAA thresholds, preview your typography and find a readable foreground without uploading a screenshot.

Local processing · No account required · Copy and export

BUILT FOR THE DETAILS
  1. 01Add your input
  2. 02Inspect & adjust
  3. 03Use your result
Browse developer tools

Workspace

PixelOkay · Developer tools
Accessible headings & text

Preview how these colors appear in a real interface.

Accessibility audit regression comparison

Baseline → Candidate · Local JSON files

Import two saved accessibility audit result snapshots, compare evidence at the affected-node level, and export a reviewable difference report. This is a separate workflow from the color-contrast checker above; it does not scan webpages or certify WCAG conformance.

Automated findings are not a complete WCAG 2.2 AA assessment. INCOMPLETE requires manual review. Unknown scope, disabled rules, changing DOM or different audit conditions can make findings NOT_COMPARABLE. Zero new issues is not proof of accessibility.

Not loaded

Choose or drop a supported axe-core / PixelOkay snapshot JSON (max 2 MiB).

Not loaded

The two files are processed locally; no URL is fetched.
Comparison settings and optional rule aliases
Aliases only apply when you enter them. Keep mappings versioned in the saved comparison project.
Only overrides the URL comparison; viewport, DOM state, excluded elements and other scope blockers still apply.

Select both audit reports or try the sample.

A saved project contains the original full audit contents; review carefully before sharing it.

How to use WCAG Color Contrast Checker

  1. Enter foreground and background HEX values, or use the color pickers. Three-digit HEX is expanded automatically.
  2. Set your preview font size and weight. Choose a contrast target before using the foreground suggestion.
  3. Read every threshold result, then copy the CSS pair or download a text report for your design review.

When to use this tool

Check the contrast of interface text, buttons or chart labels before handing colors to a developer. This is a color-pair test, not a complete accessibility audit of a webpage.

How color contrast is calculated

The ratio compares the relative luminance of two sRGB colors. Black on white gives 21:1; identical colors give 1:1. Normal text needs 4.5:1 for AA and 7:1 for AAA. Large text uses 3:1 and 4.5:1 respectively. Large means at least 24 CSS pixels, or about 18.67 pixels when bold. The displayed ratio is rounded; pass/fail uses the unrounded value.

Worked example

Foreground: #000000
Background: #ffffff
Contrast: 21.00:1
Normal text: AA and AAA pass

Review each button state as a separate color pair

  1. For an authored interface review, list actual default/hover foreground and background colors. Enter the first opaque pair with preview size and weight matching the intended text.
  2. Read the role and pass/fail result, not just the rounded ratio. Repeat for the other colors rather than assuming the preview button represents all states.
  3. For a suggestion, select the intended ratio target. The search proposes grayscale foregrounds; it does not preserve brand hue automatically.
  4. Copy declarations or download the report, keeping state/text-role context with the design review. A pair result does not evaluate a photo, gradient or alpha overlay.

Authored review workflow, no component measurement or conformance assessment. Keyboard use, focus visibility and semantics remain outside this calculation. Use Color Converter for sRGB notation or Palette Generator to explore candidates.

Limits and output checks

This checker evaluates opaque solid-color pairs. Transparency, gradients, images, focus states and the actual rendered font need additional review. A passing color pair does not establish that a whole website conforms to WCAG.

Reference: WCAG contrast guidance.

Frequently asked questions

Does 4.49:1 pass AA for normal text?

No. The minimum is 4.5:1; rounding a displayed ratio does not turn a lower ratio into a pass.

Can I check buttons and icons?

Use the 3:1 result as a starting point for relevant non-text contrast checks, then assess adjacent colors, states and the applicable WCAG exceptions.

Why does the suggested foreground change?

The suggestion searches grayscale colors for one that meets your selected ratio against the current background. Your brand color is not preserved automatically.

Check an actual foreground/background pair

Enter the two opaque solid colors used together and review the reported ratio for the relevant role. Compare other states and placements separately.

Scope of this workflow

This color-pair calculation is not a complete WCAG conformance assessment. Images, gradients, alpha and actual rendering need their own review.

Color Converter — HEX, RGB, HSL & HSV · All developer tools · Privacy policy · Contact PixelOkay