Calculates the contrast ratio between text and background colors and tells you whether it passes web accessibility standards (WCAG).
How to use
1
Enter the text color and background color.
2
Check the contrast ratio.
3
If it falls short of the standard, adjust the colors.
Tips
4.5:1 or higher is recommended for body text, and 3:1 or higher for large text.
Frequently asked questions
QWhat are the WCAG contrast ratios?
Under AA, regular text needs 4.5:1 and large text 3:1. The stricter AAA requires 7:1 for regular text.
QIn what format do I enter the text and background colors?
Enter a HEX code or pick the color directly. The contrast ratio and pass or fail result are shown right away.
Learn more
1How is the contrast ratio judged?
It expresses the brightness difference between text color and background color as a number from 1:1 to 21:1. The Web Content Accessibility Guidelines (WCAG) usually recommend 4.5:1 or higher for normal text and 3:1 or higher for large text, and the stricter AAA level is 7:1 or higher.
2How to fix low contrast
The simplest fix is to make the text color darker or the background lighter. Light gray text and text placed over photos are frequent problems, so try putting a semi-transparent background behind it. Do not distinguish information by color alone: adding icons or underlines lets people who have trouble telling colors apart read it too.
3How is contrast ratio calculated?
The WCAG contrast ratio compares the relative luminance of two colors and is found as (lighter + 0.05) ÷ (darker + 0.05). The value runs from 1:1 (the same color) to 21:1 (black and white). The human eye is most sensitive to green and least sensitive to blue, so it is calculated from real brightness, not from color names.
Take one gray text as an example: #777777 text on a white background is about 4.48:1, which falls just short of the body-text standard (4.5:1). One step darker, #767676, is about 4.54:1 and passes. Even if they look almost the same to the eye, one can end up above the standard and the other below it.
4What are AA and AAA?
AA is the commonly required standard: 4.5:1 for normal text and 3:1 for large text. AAA is stricter: 7:1 for normal text and 4.5:1 for large text. Large text means roughly 24px (18pt) or more, or about 18.7px (14pt) or more if it is bold.
For interface components such as button borders, input borders and icons, a difference of at least 3:1 from the adjacent color is recommended. Public websites in Korea and abroad often require AA, so in practice passing AA is the basic goal.
5Design that doesn't rely on color alone
Even if you pass the contrast ratio, people with color vision deficiency or color blindness have trouble telling red from green. Don't show errors in red alone; add an icon or text as well. Charts should also use different line shapes or patterns so they can still be told apart if printed in black and white.
In dark mode the background is dark, so white text can actually be too dazzling. Use a slightly dimmer white (for example #E5E7EB) instead of pure white, and check the contrast separately for each mode.
6How light can gray text be on a white background?
On a white background, #767676 is about the lightest gray for body text that still passes the AA standard (4.5:1).
The table below shows contrast ratios calculated on a white (#FFFFFF) background. Even within the same gray family, one step can decide pass or fail.
#1F2937
Contrast ratio
14.68
Body text (AA 4.5)
Pass
Large text (AA 3)
Pass
#6B7280
Contrast ratio
4.83
Body text (AA 4.5)
Pass
Large text (AA 3)
Pass
#767676
Contrast ratio
4.54
Body text (AA 4.5)
Pass
Large text (AA 3)
Pass
#777777
Contrast ratio
4.48
Body text (AA 4.5)
Fail
Large text (AA 3)
Pass
#949494
Contrast ratio
3.03
Body text (AA 4.5)
Fail
Large text (AA 3)
Pass
#9CA3AF
Contrast ratio
2.54
Body text (AA 4.5)
Fail
Large text (AA 3)
Fail
Text color
Contrast ratio
Body text (AA 4.5)
Large text (AA 3)
#1F2937
14.68
Pass
Pass
#6B7280
4.83
Pass
Pass
#767676
4.54
Pass
Pass
#777777
4.48
Fail
Pass
#949494
3.03
Fail
Pass
#9CA3AF
2.54
Fail
Fail
Small text such as captions, dates and secondary descriptions is where pale gray is most often used. Check those places first.
7How large does large text have to be?
Regular text of about 24px (18pt) or more, or bold text of about 19px (14pt) or more, counts as large text and gets the lower standard (3:1).
The same criteria are explained in this tool's items. Passing the large-text standard does not mean passing the body-text standard, so judge by checking the actual text size and weight.
Body text, helper text, button labels: 4.5:1 or higher recommended
Large headings, large bold text: 3:1 or higher
The stricter AAA: 7:1 for body text, 4.5:1 for large text
8How do I check whether white text passes on a brand-colored button?
Enter the button's background color in the background box and the text color in the text box and you will know right away. Popular mid-tone colors are often borderline with white text.
For example, white text on blue #3B82F6 is 3.68:1, which falls short of the body standard (4.5). Changing to the one-step-darker #2563EB gives 5.17:1, which passes. The purple #6366F1 with white text is 4.47:1, just barely short of 4.5.
#3B82F6
White text contrast
3.68
Body standard (4.5)
Fail
#2563EB
White text contrast
5.17
Body standard (4.5)
Pass
#6366F1
White text contrast
4.47
Body standard (4.5)
Fail
#10B981
White text contrast
2.54
Body standard (4.5)
Fail
Background color
White text contrast
Body standard (4.5)
#3B82F6
3.68
Fail
#2563EB
5.17
Pass
#6366F1
4.47
Fail
#10B981
2.54
Fail
9On a light background color, which is better: white text or black text?
If the background is of medium brightness or lighter, dark text often has higher contrast than white text.
On green #10B981, white text is 2.54:1, but very dark #111111 text is 7.44:1 and much easier to read. White text on yellow #FDE047 is 1.32:1, which is practically unreadable. Using dark text on light-colored buttons is the basic rule.
The feeling that white text looks prettier is different from how readable it is. Check the numbers first.
10Are there standards for icons and input borders too?
Yes. Icons, input borders and focus indicators needed to recognize functionality on screen are recommended to have at least 3:1 against adjacent colors.
This corresponds to WCAG's non-text contrast criterion (1.4.11). Many people find inputs with pale gray borders hard to see. This tool's "Icons and input borders" item checks this standard.
Input borders: at least 3:1 against the background
Selection marks of checkboxes and radio buttons
Keyboard focus indicators (outlines)
Icons that convey meaning
11How is the APCA score (Lc) different from the WCAG ratio?
The WCAG ratio looks only at the luminance ratio of two colors, while APCA also considers the polarity of text and background (light text on dark versus dark text on light), calculating something closer to visual perception.
This tool shows the APCA Lc value as well, and as a rough guide by absolute value, about 45 or more is for large text or headings, 60 or more is the minimum for body text, and 75 or more is sufficient for body text. It is useful as a reference when results feel different from WCAG, as with white text on dark backgrounds.
APCA is not yet an official legal standard. If your goal is submission or certification, prioritize the WCAG ratio.
12How do I check text over photos or gradients?
If the background is not a single color, you need to check the lightest spot, the darkest spot and the color where the text actually sits.
Pick up the color directly beneath the text with an eyedropper or color code and compare it. If any one falls short, you can lay a semi-transparent dark layer behind the text or give the text a shadow or a background band.
For text over photos, lay a dark semi-transparent overlay first
For text over gradients, test with the color of the most unfavorable section
Increase the text size or make it bold to check whether the large-text standard can apply
13Do I need to check contrast separately in dark mode too?
Yes. A color that passes in light mode is not guaranteed to pass in dark mode, so check each mode.
On dark backgrounds, pure white text can be glaring, so a slightly dimmed white is often used. Even so, keep body text at 4.5:1 or higher and check that dim secondary text colors have not gotten too close to the background.
14Are there exceptions to the contrast standards?
Disabled buttons, purely decorative elements and logos (brand names) are treated as exceptions to the standard.
However, an input that looks disabled but is actually clickable is not an exception. Also, the common view is that placeholder text should meet the same contrast standard as body text, so even when it is light, at least 3:1 and preferably 4.5:1 is recommended.
If you are unsure whether something is an exception, it is safer to use a color that passes.
15If it falls short of 4.5, can I round it up and call it a pass?
No. 4.499 is not 4.5.
WCAG does not accept rounding a calculated result to meet the standard. This tool also rounds down at the second decimal place instead of rounding up, so a value just short of the standard does not appear to pass by mistake. If your number is right below passing, darken the color by just one step.
16How do I use the suggestion feature when I want to fix a color?
If a color falls short of the standard, the tool calculates the closest color and shows it as a button that changes the text color or background color.
Change text color (AA): a color similar to the original that exceeds 4.5:1
Change text color (AAA): a color that exceeds 7:1
Change background color: keep the text color and adjust only the background
Suggested colors are a starting point, so check by eye again that they fit the design
The colors you enter are calculated only inside your browser and are not sent to a server.
17How does this relate to Korean web accessibility standards?
The Korean Web Content Accessibility Guidelines (KWCAG) also require luminance contrast between text and background, with criteria similar to WCAG.
For public institutions or services that need certification, check the latest version and detailed criteria of the guidelines that apply for that year from official sources. The results of this tool are for reference and do not replace a certification review.
18Worked example: fixing white text on a purple button
Darkening the original color by just one step can keep the design feel while passing the standard.
If the button background is #6366F1 and the text is white, the contrast is 4.47:1, just barely short of AA. Use the background suggestion feature to see a nearby passing color, or try switching the background to a slightly deeper purple.
Step 1: Enter #FFFFFF in the text box and #6366F1 in the background box
Step 2: Check whether the AA body text item in the results fails
Step 3: Look at the background or text color candidates with the suggestion buttons
Step 4: Test again with the changed colors and check by eye on the actual screen
19What else should I consider for users with color vision deficiency or low vision?
Keeping the contrast ratio is the first basic rule, and not conveying meaning with color alone is the second.
Do not separate success and failure using only combinations such as red and green, which are hard for users with color vision deficiency to tell apart. Adding supporting cues such as icons, text or patterns makes it easier for everyone to understand. Brightness contrast is the most reliable cue, even for people who have trouble distinguishing hues.
Even when you look at your phone outdoors in sunlight, low-contrast text is hard to read. Contrast is a standard for everyone.
20Color contrast checklist before handing off a design
Only the criteria needed for each type of screen element, organized in one table.
Body text
Recommended minimum ratio
4.5:1
Point to check
Also check areas where the background changes
Large headings
Recommended minimum ratio
3:1
Point to check
Judge size and weight together
Link text
Recommended minimum ratio
4.5:1
Point to check
An underline or weight that sets it apart from body text is recommended
Button borders, inputs
Recommended minimum ratio
3:1
Point to check
Default, focus and error states
Icons
Recommended minimum ratio
3:1
Point to check
Only icons that convey meaning
Error messages
Recommended minimum ratio
4.5:1
Point to check
Check reds especially on white backgrounds
Element
Recommended minimum ratio
Point to check
Body text
4.5:1
Also check areas where the background changes
Large headings
3:1
Judge size and weight together
Link text
4.5:1
An underline or weight that sets it apart from body text is recommended
Button borders, inputs
3:1
Default, focus and error states
Icons
3:1
Only icons that convey meaning
Error messages
4.5:1
Check reds especially on white backgrounds
21Frequently asked questions
Only the questions that come up most often when checking color contrast.
What is a 21:1 contrast ratio? It is the combination of black and white, the maximum possible value. Conversely, identical colors give 1:1.
Does swapping the text and background colors change the result? The WCAG ratio is the same regardless of which is the text. The APCA score can differ depending on polarity.
Can I use rgb() or a color name instead of HEX? The input accepts any format recognized as a color. Invalid values are flagged with a red border.
Is it legally required? Public services and some obligated entities may be required to follow the guidelines. Check official guidance on whether it applies to you.
My design mockup is only a PNG. What should I do? Extract the colors from the mockup and enter them as codes to check. Screen captures can have slightly different colors due to compression.
22How do I check link, selected and focus states too?
People often match only the static screen and miss the state changes, so enter and test the colors for each state separately.
Even a single button has default, hover, pressed, selected, disabled and focus states, and the background and text colors change each time. If you write the state colors down line by line and enter them one at a time, you will hardly miss anything.
Whether the background darkening on hover actually reduces contrast with the text
Whether selected tabs and chips are distinct from unselected ones while keeping enough contrast
Whether error messages have at least 4.5:1 against the background