Contrast Checker

Check WCAG text contrast.

Live preview

Readable at a glance

Large text, 28px bold

Pack my box with five dozen liquor jugs. How vexingly quick daft zebras jump when the light changes.

Normal text, 16px

Filled buttonOutline button

UI components and icons

Contrast ratio

3.66:1

AA Large

Only large text and UI components pass

  • Normal text

    Body copy under 24px, or under 18.66px bold

    AA 4.5:1, failAAA 7:1, fail
  • Large text

    24px and up, or 18.66px and up in bold

    AA 3:1, passAAA 4.5:1, fail
  • UI components and graphics

    Buttons, input borders, icons and chart marks

    AA 3:1, pass

Fix it

  • AA for normal text

    #6c7885 · 4.50:1

  • AAA for normal text

    #515a64 · 7.00:1

Online color contrast checker

Check the WCAG contrast ratio of any text and background colors, see which levels pass, and fix a failing pair with the closest passing color. It runs in your browser and works on phones and keyboards.

  • WCAG 2.2 contrast ratio. Enter a text color and a background color and see the exact ratio, from 1:1 for identical colors up to 21:1 for black on white.
  • Every level checked at once. See AA and AAA results for normal text, large text and UI components together, each marked pass or fail with an icon, not only a color.
  • Fix it in one tap. When a pair fails, the checker finds the closest color that passes AA or AAA, keeping the same hue, and applies it when you tap Use this.
  • Change the text or the background. Choose which side to adjust. If the text color is part of your brand, fix the background instead.
  • Live preview. See large text, body text, filled and outline buttons and an icon in your colors as you type, so you judge the pair as well as the number.
  • Hex, RGB and HSL. Type a hex code, an rgb() value or an hsl() value, or use the color picker. Everything is shown back as a hex code you can copy.
  • Honest rounding. Ratios are cut off, not rounded up, as the WCAG rules require. A 4.499 ratio never shows as 4.5 and never passes.
  • Swap, reset and copy. Swap text and background with one tap, reset to the starting pair, or copy a plain-text summary to paste into a ticket or a design review.

Contrast checker troubleshooting

Something not working the way you expect? Here is what the most common problems usually mean.

  • My color is not accepted.. Use a hex code such as #1a2b3c or #abc, an rgb() value such as rgb(26 43 60), or an hsl() value such as hsl(210 40% 17%). Color names like "red" are not supported.
  • The ratio passes but the text is hard to read.. The ratio does not measure thin fonts, small sizes or glare. Treat it as a minimum, check the live preview and prefer a higher ratio for small or light text.
  • Fix it says the color is not reachable.. Even pure black or white cannot reach the target against some mid-tone backgrounds. Change the other color, using the toggle above the suggestions.
  • The suggested color looks different from mine.. The suggestion keeps your hue and saturation and only changes the lightness by the smallest amount needed. It is always the closest passing color in that direction.
  • My transparent color gives a different result.. This tool compares solid colors. Mix a semi-transparent color with what is behind it first, then enter the final solid color.
  • The result differs from another checker by a hundredth.. Some tools round up. This one cuts off the extra digits, which is the safe way to read the WCAG thresholds.

When a contrast check helps

  • Choosing a brand palette. Check each text and background pair before you commit to a color scheme, rather than finding problems after launch.
  • Designing dark mode. Dark themes often use soft gray text on a dark background. Test that the grays still reach 4.5:1.
  • Accessibility audits. Verify a color pair reported by an audit tool, and copy the result into your report.
  • Buttons, links and form borders. Input borders, focus rings and icons need 3:1 against what is behind them. Check them as UI components.
  • Charts and data visuals. Check that chart lines, bars and labels can be told apart from the background and from each other.
  • Placeholder and disabled text. Light gray hints are a common failure. See how far from passing they are and how much darker they need to be.

Contrast questions

What is a good contrast ratio?

WCAG AA needs at least 4.5:1 for normal text and 3:1 for large text and UI components. AAA needs 7:1 for normal text and 4.5:1 for large text.

What counts as large text?

Text at 24px or bigger, or 18.66px or bigger in bold. Anything smaller counts as normal text.

How is the contrast ratio calculated?

Each color is converted to its relative luminance using the sRGB formula. The ratio is (lighter + 0.05) divided by (darker + 0.05), which gives a number from 1 to 21.

Does it matter which color is the text?

No. The ratio is the same either way around. The labels only decide which color the preview and the fix suggestions treat as text.

Do logos and decorative images need to pass?

No. WCAG does not require contrast for logos, purely decorative elements or disabled controls, though readable ones are still better.

Are there legal requirements for contrast?

Many accessibility laws and procurement rules point to WCAG AA, so reaching 4.5:1 for text is the usual target. Check the rules that apply to your product.

Is anything uploaded?

No. All calculations run in your browser and your colors never leave the page.

Does it work on a phone?

Yes. The color pickers and buttons are large enough to tap, and the layout stacks on small screens.