Skip to content
Koit Academy

Color contrast checker

Your details

Hex such as #1A2B3C or #abc, or rgb(26, 43, 60). An alpha value is blended over the background.

The details filled in are an example. Everything runs in this browser; nothing you type is sent anywhere or stored.

CSS

Contrast 5.90:1. Passes AA for all text; fails AAA for normal text.

Normal text, 16pxLarge text, 24px
CheckNeedsResult
Normal text, AA4.5:1Pass
Large text, AA3:1Pass
Normal text, AAA7:1Fail
Large text, AAA4.5:1Pass
Icons and controls, AA3:1Pass
color: #5B6573;
background-color: #FFFFFF;
/* Contrast 5.90:1. Passes AA for all text; fails AAA for normal text. */
  • Note: For AAA with normal text, #515966 reaches 7.06:1 on this background.
  • Note: WCAG does not round: 4.49:1 fails 4.5:1, so the ratio here is cut off, never rounded up. Thin or unusual fonts can need more contrast than the ratio suggests.

How to use it · free, no signup

How to use the Color Contrast Checker

Enter a text colour and a background colour to see their contrast ratio, whether they pass WCAG AA and AAA, and the nearest shade that would pass. Runs in your browser.

  1. 01

    Enter the text colour

    As hex, such as #5B6573, or rgb(91, 101, 115). Transparency is blended over the background.

  2. 02

    Enter the background

    The solid colour behind the text.

  3. 03

    Read the checks

    Pass or fail for each size and level, and the nearest colour that passes if it fails.

The ratio and what it must reach

WCAG measures contrast as a ratio from 1:1, the same colour twice, to 21:1, black on white. It is worked out from each colour’s relative luminance, how bright it looks once the red, green and blue channels are weighted for the eye. The thresholds are set by three success criteria (W3C: Understanding Contrast (Minimum)):

ContentAAAAA
Normal text4.5:17:1
Large text: 24px, or 18.5px bold3:14.5:1
Icons, borders of controls, chart lines3:1-

The starting colours, #5B6573 on white, reach 5.90:1: enough for AA at any size, short of AAA for normal text. The tool suggests #515966, which reaches 7.06:1.

No rounding, and no shortcuts

The ratio is compared exactly: 4.49:1 fails 4.5:1, so this page cuts the figure off rather than rounding it up. Two other points catch people out. Transparent text is drawn blended with whatever is behind it, so a 50% black on white is measured as the grey you see, about 4:1. And thin or unusual fonts can need more contrast than the ratio suggests, because the thresholds assume ordinary letterforms.

Fixing a colour that fails

  • Darken or lighten the text, not the brand colour itself: the tool finds the nearest shade that passes, keeping the hue.
  • Use the brand colour for large type or for shapes, where 3:1 is enough, and a darker shade for body text.
  • Check every state, such as hover, focus and disabled-looking but active buttons, not only the default.
  • Check text on images against the lightest part of the image behind it.

Beyond colour

Contrast is one part of a page people can read. The readability checker looks at the words, the heading structure checker at how the page is organised for screen readers, and the image alt text checker at what images say to people who cannot see them.

Published by Koit Academy. Who runs it, how it is paid and how its tools are checked.

Questions

What people ask about the Color Contrast Checker

What contrast ratio does WCAG require?
At level AA, 4.5:1 for normal text and 3:1 for large text. At AAA, 7:1 and 4.5:1. Icons and the edges of controls need 3:1.
What counts as large text?
At least 18 point, about 24px, or 14 point bold, about 18.5px. Anything smaller needs the normal-text ratio.
Is 4.48:1 close enough to pass?
No. WCAG compares the exact ratio with the threshold and does not round, so anything under 4.5:1 fails AA for normal text.
How is the contrast ratio calculated?
From the relative luminance of each colour: the lighter one’s luminance plus 0.05, divided by the darker one’s plus 0.05. It runs from 1:1 to 21:1.
Do logos need to meet contrast requirements?
No. Text in a logo or brand name is exempt, and so is purely decorative text and text in inactive controls.