Skip to content
DeviceCheckHub

Color Contrast Checker

Check whether text is readable on its background. See the contrast ratio and every WCAG 2.2 result at once, get the nearest color that passes, and preview it for color blindness.

 

Type a HEX code (#1F2937 or #1F2937CC), rgb(), hsl() or a color name such as navy.

Contrast ratio

14.67:1

Passes every WCAG text level (AAA)

WCAG 2.2AAAAA
Normal text (4.5 and 7)PassPass
Large text (3 and 4.5)PassPass
Icons and input borders (3)Pass–

APCA (draft WCAG 3, for information): Lc 101.5, preferred for body text and small text

Large text, 24 px

Large bold text, 18.7 px

Normal text at 16 px is what most paragraphs use, so it needs the higher ratio.

Small text, 14 px, such as captions and notes.

Button outlineIcon

How it looks with color blindness

Sample text
Protanopia (no red cones): 14.35:1
Sample text
Deuteranopia (no green cones): 14.89:1
Sample text
Tritanopia (no blue cones): 14.62:1
Sample text
Achromatopsia (no color): 14.74:1
Text #1F2937 on #FFFFFF: contrast 14.67:1. Passes every WCAG text level (AAA).

How to use the contrast checker

What the contrast ratio means

The contrast ratio compares how much light the lighter color gives off with how much the darker one does. It runs from 1:1, when the two colors are the same, to 21:1, for black on white. Hue doesn’t enter into it: a red and a green with the same brightness have a ratio close to 1:1, which is why they are hard to tell apart for many people.

The formula comes from the Web Content Accessibility Guidelines. Each color’s relative luminance L is worked out from its red, green and blue values (each converted from the screen’s gamma to linear light, then weighted 21% red, 72% green and 7% blue, because the eye is most sensitive to green). The ratio is then (L1 + 0.05) ÷ (L2 + 0.05), with L1 the lighter color. The 0.05 stands for the glare of a typical screen.

WCAG AA and AAA levels

WhatLevel AALevel AAA
Normal text4.5:17:1
Large text (24 px, or 18.7 px bold)3:14.5:1
Icons, input borders, focus outlines, chart lines3:1–

AA is the level most laws and policies point to, including the European accessibility standard EN 301 549 and the US Department of Justice rule for state and local government websites under the Americans with Disabilities Act, which adopts WCAG 2.1 AA. AAA is a stricter target that helps people with low vision even more. The text rules are WCAG success criteria 1.4.3 and 1.4.6, and the rule for icons and controls is 1.4.11.

Examples

TextBackgroundRatioResult
#000000#FFFFFF21.00:1AAABlack on white, the highest possible contrast
#767676#FFFFFF4.54:1AAThe lightest gray that still passes AA on white
#777777#FFFFFF4.47:1Large text onlyOne step lighter, and it fails AA
#595959#FFFFFF7.00:1AAAThe lightest gray that passes AAA on white
#0000EE#FFFFFF9.39:1AAAThe classic blue of an unvisited link
#FFFFFF#2563EB5.16:1AAWhite on a strong blue button
#FFFFFF#16A34A3.29:1Large text onlyWhite on a bright green button
#FFFFFF#F59E0B2.14:1FailsWhite on amber, a common warning color
#1F2937#F59E0B6.83:1AADark text on the same amber

Bright, saturated colors such as green, amber and light blue are often too light for white text. Darker text on them, or a darker shade of the color, usually fixes it.

How to fix low contrast

APCA, the newer contrast method

APCA (Accessible Perceptual Contrast Algorithm) rates contrast as a lightness contrast value, Lc, from about 0 to 106 for dark text on light backgrounds and to −108 for light text on dark ones. It models human vision more closely than the WCAG 2 ratio, especially for dark backgrounds and thin fonts, and it ties the value you need to the size and weight of the text. Lc 75 is a common minimum for body text and Lc 90 is preferred. APCA is being considered for WCAG 3, which is still a draft, so the checker shows it for information; to meet today’s requirements, use the ratio.

Contrast and color blindness

According to the US National Eye Institute, about 1 in 12 men have a color vision deficiency, and women much less often; the most common type makes red and green hard to tell apart. The previews show your pair as it may look with each of the main types, simulated with the Machado, Oliveira and Fernandes model. Because the contrast ratio measures lightness, a pair that passes usually stays readable, but colors that differ only in hue can look the same.

To find exact codes for a color, use the color picker, which also shows how a color works against white and black.

Frequently asked questions

What contrast ratio does WCAG require?

For level AA, normal text needs at least 4.5:1 against its background and large text needs 3:1. For level AAA, normal text needs 7:1 and large text 4.5:1. Icons, input borders, focus outlines and other parts you need to see to use a page need 3:1 (success criterion 1.4.11).

What counts as large text?

WCAG defines large text as at least 18 point (24 CSS pixels) in a regular weight, or at least 14 point (about 18.7 CSS pixels) in bold. Anything smaller is normal text and needs the higher ratio.

Is 4.49:1 close enough to pass 4.5:1?

No. The WCAG thresholds are minimums, so 4.49:1 fails AA for normal text. This checker shows the ratio to two decimals without rounding up, so a value shown as 4.50:1 really passes.

How does the checker suggest a passing color?

It keeps the hue of your color and changes only its lightness, moving it away from the other color (dark text gets darker, light text lighter) just until the contrast reaches the level you need, so the design keeps its light-on-dark or dark-on-light look. It suggests a new background the same way, when one is possible. Press Use to try a suggestion.

What is the APCA number?

APCA (Accessible Perceptual Contrast Algorithm) is a newer way to measure contrast that is being considered for WCAG 3, which is still a draft. It is shown for information only. Today’s standards, such as WCAG 2.2, EN 301 549 and the US Justice Department’s ADA rule for public websites, use the contrast ratio.

Do logos and disabled buttons need enough contrast?

WCAG makes exceptions for text in logos and brand names, for purely decorative text and for inactive (disabled) controls. They are still easier for everyone to see with good contrast, but they don’t fail the guideline.

Are my colors sent anywhere?

No. Everything is calculated in your browser. The two colors are kept in the page address so you can bookmark or share the check, and nothing is uploaded.

Last updated · About DeviceCheckHub