Color Contrast Checker

Check whether text is readable on a background, against WCAG levels.

Color Contrast Checker tool

1.00
Contrast ratio
—
Best level reached

Preview

Large heading text

Normal body text at the size most paragraphs use. Readable contrast matters most here, because this is where people spend their reading time.

WCAG checks

RequirementNeedsResult

About the Color Contrast Checker

Text that does not stand out from its background is hard to read in sunlight, on cheap screens and for people with low vision. This contrast checker calculates the WCAG contrast ratio between any two colors, from 1:1 for identical colors to 21:1 for black on white, and shows which accessibility levels pass for normal and large text. The difference can be tiny: #767676 grey on white passes the 4.5:1 AA level, while the almost identical #777777 just fails. When a pair fails, the tool suggests the nearest color that passes. For choosing colors, use the Color Picker, and to see how designs look with color blindness, the Color Blindness Simulator.

The WCAG guidelines turn that ratio into pass marks. Ordinary paragraph text needs 4.5 to 1 for level AA and 7 to 1 for the stricter level AAA. Large text, which means about 24 pixels or more, or about 19 pixels when bold, only needs 3 to 1 for AA and 4.5 to 1 for AAA. User interface parts such as input borders and icon buttons need 3 to 1 against what surrounds them. The checker reports each of these tests on its own, because a colour pair may be perfectly good for a heading and still too faint for body copy.

Your two colours are also previewed as real sample text in both sizes, which is often more convincing than a number. If a combination fails, the tool works out the closest version of your text colour that passes by making it lighter or darker, and you can apply that suggestion straight away instead of starting your search again.

How to use the Color Contrast Checker

  1. Pick the text colourUse the colour picker or type a HEX code.
  2. Pick the background colourDo the same for the surface the text sits on.
  3. Read the resultsThe ratio is shown with a separate pass or fail for each WCAG level and text size.
  4. Fix a failing pairApply the suggested nearby colour with one click if the combination does not pass.

Color Contrast Checker features

  • Contrast ratio worked out from relative luminance, as WCAG defines it
  • Separate results for normal text, large text and interface parts
  • Level AA and level AAA judged independently
  • Sample text previewed at both sizes
  • Closest passing colour suggested when a pair fails
  • Text and background swapped with one click
  • Results written out in words, so they do not depend on colour

Common uses

  • Testing brand colours before they are used for paragraph text
  • Rescuing a button label that people struggle to read
  • Auditing a live website for accessibility problems
  • Finding a text colour that works on a coloured banner
  • Recording which colour pairs are approved in a design system

Checking contrast in practice: fixing a brand-coloured button, grey text, disabled controls, icons and borders, text on images and future methods

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

Low contrast is one of the most common accessibility failures on the web, and it affects far more people than those with diagnosed vision problems: anyone reading a phone in sunlight, older visitors and people on cheap, dim screens. This guide fixes a failing brand-coloured button and covers light grey text, disabled controls, icons and borders, text over images, Urdu text and the newer contrast method being discussed for future guidelines.

A worked example: a green button

A brand uses the bright green #22c55e for its buttons with white text. The contrast ratio is only about 2.3 to 1, well below the 4.5 to 1 required for normal text at level AA. Darkening the green to #15803d raises the ratio to about 5.0 to 1, which passes, while still reading clearly as the brand's green. Keeping the bright green for decorative areas without text preserves its freshness.

Grey text

Light grey text looks elegant in mockups and fails in real use. Grey #9ca3af on white has a ratio of about 2.5 to 1, while #6b7280 reaches about 4.8 to 1. Captions, dates, placeholders and footer text are the usual offenders. Choosing the darker grey keeps the subtle look while remaining readable.

Disabled controls and placeholders

The guidelines exempt disabled, inactive controls from contrast requirements, which is why greyed-out buttons may look faint. Placeholder text in form fields is not exempt when it carries information, and very faint placeholders are a common failure. Visible labels above fields are better than relying on placeholders at all.

Icons, borders and focus rings

Text is not the only thing that needs contrast. Icons that convey meaning, the borders of input fields and focus indicators need a contrast ratio of at least 3 to 1 against their surroundings. Pale grey input borders on white often fail, making forms hard to see for people with low vision.

Text on images

Contrast over a photo varies across the image, so test text against the lightest area behind it. Darkening the image under the text, adding a solid or semi-transparent panel or moving the text to a plain area makes the result reliable instead of dependent on the photo chosen.

Urdu text

Nastaliq script has fine details that blur at small sizes, so Urdu text benefits from contrast comfortably above the minimum and from a slightly larger font size. Testing real Urdu paragraphs, rather than English placeholder text, gives a truer picture of readability.

Phones outdoors

Bright sunlight washes out screens and lowers effective contrast. Many visitors in Pakistan browse on phones outdoors, in shops and on the move, so designs that just pass in an office may be hard to read in real conditions. Aiming above the minimum gives a margin for these situations.

Future methods

A newer approach to measuring contrast, known as APCA, is being explored for future accessibility guidelines and accounts for font size and weight more precisely. For now, the WCAG 2 ratios checked here remain the standard used in audits, procurement and accessibility laws.

Common mistakes

  • Using bright brand colours behind white text without checking.
  • Styling secondary text in very light grey.
  • Ignoring borders, icons and focus indicators.
  • Testing text over images only in the darkest area.

Related tools

To find a darker shade of a brand colour, use Color Shades Generator. To pick colours visually, try Color Picker, and to apply the result to buttons, CSS Button Generator.

Links within paragraphs

Links that are distinguished from surrounding text only by colour need a contrast of at least 3 to 1 against that text, plus another cue, such as an underline, when hovered or focused. The simplest solution is to underline links in body text, which helps everyone recognise them at a glance.

Charts and graphs

Adjacent segments in charts should differ enough to tell apart, ideally with at least 3 to 1 contrast between neighbouring colours, or be separated by thin white borders. Labels placed directly on or beside segments help more than a colour legend, especially for readers with colour vision deficiencies.

Logos are exempt

Text that is part of a logo or brand name is exempt from contrast requirements, so a pale logo is not an accessibility failure in itself. Other text using the same colours, such as headings or buttons, still needs to meet the requirements.

Check every state

Buttons and links change colour on hover, focus and when pressed. Each state needs adequate contrast, and hover colours are often lighter and fail even when the default state passes. Keeping a short table of approved colour pairs, with their ratios, makes these checks quick for everyone on a team.

Dark mode needs its own checks

Colour pairs that pass on a white background may fail in dark mode, and very bright text on black can feel harsh even when it passes. Check every important pair in both themes, and soften pure white text on dark backgrounds to a light grey that still meets the ratio comfortably.

Privacy

Contrast is calculated in your browser. The colours you enter are not uploaded or stored.

Further reading: HEX, RGB and HSL Colour Codes, and Accessible Contrast.

Frequently asked questions

What size counts as large text?

About 24 pixels and above for regular weight, or about 19 pixels and above for bold. Bigger letters are easier to make out, so they get a lower threshold, which is why a colour can pass for a heading but fail for body text.

How do AA and AAA differ?

AA is the level most organisations target and the one most often written into laws, contracts and public sector rules. AAA is stricter and is not always achievable for a whole design, particularly when brand colours cannot change.

If my colours pass, is the design fully accessible?

Not necessarily. Contrast covers how readable text is against its background. You also need to avoid relying on colour alone to carry meaning, such as red for errors, and to consider people with different kinds of colour vision.

How is the contrast ratio worked out?

Each colour's relative luminance is calculated from its red, green and blue values after a gamma correction. Then the lighter value plus 0.05 is divided by the darker value plus 0.05, which is why the scale runs from 1 to 21.

Can I test a colour with transparency?

Not reliably, because contrast depends on the colour that actually ends up on screen. Work out the solid colour the transparent one produces over its real background, then check that solid colour instead.

Why does the suggested fix only change lightness?

Lightness is the smallest change that keeps the feel of your colour. Holding the hue and saturation steady while making the text lighter or darker usually leaves the result recognisably on brand.