WCAG, the Web Content Accessibility Guidelines, says text needs a contrast ratio of at least 4.5:1 against its background. Large text needs 3:1, and so do the parts of controls and charts you need to see. A contrast ratio compares two colours, from 1:1 for two identical colours to 21:1 for black on white.
Aim for Level AA. It’s the level UK public-sector guidance and the US rules ask for. The stricter Level AAA asks for 7:1 for text, and the W3C advises against making it a rule for whole sites.
Large text starts at 24px, or 18.67px bold. Anything smaller is normal text and needs 4.5:1, even in bold.
Borders, icons and your own focus rings need 3:1. Check them against the colours they touch, like the background behind an input’s border. A control like a checkbox has to keep that 3:1 in every state, such as hover or checked.
Check your own colours in Perception, my Figma plugin, which tests text and icons against WCAG 2 AA and AAA on the canvas.
Placeholder text needs a contrast ratio of 4.5:1 at Level AA, and a disabled button that can’t be used needs nothing at all. The two can be the same grey in the same form, and WCAG 2 treats them differently.
The tricky part is knowing which number applies to the thing in front of you, because it depends on what the element is, its size and its state. Below, every colour contrast accessibility guideline in WCAG 2.2 sits next to the part of the UI it covers. Each one comes with its exemptions from the W3C’s own text, and some with numbers I calculated myself.
WCAG 2’s contrast requirements at a glance
Every number here comes from WCAG 2.2, the current version of the standard, dated 12 December 2024.
Contrast ratio | What it applies to | Where it’s from | Level |
|---|---|---|---|
4.5:1 | Text and images of text | 1.4.3 Contrast (Minimum) | AA |
3:1 | Large text: 24px, or 18.67px bold | 1.4.3 Contrast (Minimum) | AA |
3:1 | The parts of a control you need to see to identify it and its state, and the parts of a graphic you need to understand it | 1.4.11 Non-text Contrast | AA |
3:1 | A link shown only by its colour, against the text around it (an underline also meets 1.4.1) | One way to meet 1.4.1 Use of Color (technique G183) | A |
7:1 | Text and images of text | 1.4.6 Contrast (Enhanced) | AAA |
4.5:1 | Large text | 1.4.6 Contrast (Enhanced) | AAA |
3:1 | A focus indicator at least as big as a 2px outline, between its focused and unfocused pixels | 2.4.13 Focus Appearance | AAA |
So 3:1 turns up in three success criteria, and in one technique for links. Each of those rules has its own page in my WCAG reference.
What a contrast ratio of 4.5:1 means
A WCAG colour contrast ratio compares the relative luminance of two colours, with a small allowance for light reflecting off the screen added to each. A ratio of 4.5:1 means the lighter colour’s relative luminance, plus 0.05, is 4.5 times the darker colour’s, plus 0.05. It’s the Level AA minimum for normal-size text. Ratios run from 1:1, two identical colours, to 21:1, black on white. So the contrast figure on a monitor’s spec sheet, like 1000:1 or 3000:1, isn’t a WCAG contrast ratio. The W3C uses the term relative luminance because web content doesn’t emit light itself.
How WCAG works out a contrast ratio
WCAG works out each colour’s relative luminance from its RGB values, adds 0.05 to each, then divides the lighter by the darker:
contrast ratio = (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter colour
L = 0.2126 R + 0.7152 G + 0.0722 B, on linearised sRGB values
to linearise a channel, divide its 8-bit value by 255. At 0.04045 or less, divide that by 12.92. Above it, use ((value + 0.055) / 1.055) ^ 2.4
In that formula, green counts for most of the result and blue for very little. The W3C says hue isn’t a key factor, because most colour vision deficiencies don’t change how people see light and dark. The exception it names is red on black or another dark colour, for people with protanopia. Swap the text and background and you get the same number: #767676 on white and white on #767676 are both 4.54:1 in my calculation.
The 4.5 comes from 3:1, the minimum in two older display standards, multiplied by 1.5 to allow for the contrast loss that comes with about 20/40 vision. What is APCA? tells that story in full.
The W3C changed the linearisation threshold in May 2021, from 0.03928 to 0.04045, and says the change has no practical effect. I checked every 8-bit channel value, and none of them falls between the two, so no hex colour’s ratio changed.
What 3:1, 4.5:1 and 7:1 look like
On white, the lightest neutral grey that reaches 3:1 is #949494, at 3.03:1 in my calculation. For 4.5:1 it’s #767676 at 4.54:1, and for 7:1 it’s #595959 at 7.00:1. The next lighter grey fails in each case: #959595 is 2.995:1, #777777 is 4.48:1 and #5A5A5A is 6.90:1.
Why a rounded 4.5:1 can still fail
W3C’s guidance on 1.4.3 says the ratios are thresholds and you don’t round them, so 4.499:1 doesn’t meet 4.5:1. It catches out a grey that looks like a pass. #777777 on white is 4.48:1 in my calculation, which a checker showing one decimal place displays as 4.5, and it fails.
AA and AAA contrast ratios
WCAG’s contrast success criteria sit at two of its three levels, AA and AAA.
Level AA: the level to meet
Level AA conformance means a page meets all the Level A and Level AA success criteria, and the contrast rules are part of that. For contrast, AA means 4.5:1 for text, 3:1 for large text and 3:1 for non-text contrast. AA is also the level GOV.UK’s guidance and the US rules ask for, as the section on the law below explains.
Level AAA: 7:1, and why it isn’t the default target
At AAA, 1.4.6 Contrast (Enhanced) asks for 7:1 for text and 4.5:1 for large text. The W3C bases 7:1 on the contrast loss that comes with about 20/80 vision. The W3C also advises against asking for AAA as a general policy for whole sites, because some content can’t meet all the AAA success criteria. So meet AA everywhere, and treat AAA as a target for body text where your palette allows it. My page on 1.4.6 Contrast (Enhanced) covers AAA text contrast.
Text contrast
1.4.3 asks for 4.5:1 for text and images of text, and 3:1 for large text. My page on 1.4.3 Contrast (Minimum) covers the details of text contrast.
What counts as large text
Large text is at least 18 point, or 14 point bold. At 1pt to 1.333px, that’s 24px, or 18.67px bold, to two decimal places. The W3C rounds the bold size to about 18.5px, but 18.5px bold is under 14pt, so it’s normal text and needs 4.5:1. Set 19px to be safe. Bold on its own doesn’t make text large either: 16px bold text is normal text. The size that counts is the one the page sets at each breakpoint, not what a user zooms to.
The W3C’s guidance says “18 point” and “bold” can mean different things in different fonts, and that those sizes may not be enough for very thin or unusual fonts. Fonts with very thin strokes are harder to read at lower contrast, so the W3C’s best practice is a heavier weight or a colour pair that beats the minimum. My page on text size covers how size and weight change which ratio applies.
Placeholder, hover and focus text
1.4.3 applies to placeholder text, and to text that appears when you hover over something or give it keyboard focus. So a placeholder needs the same 4.5:1 as the label above it.
Text on images and gradients
For text over a photo, W3C’s failure F83 says to check the text against the parts of the image that are most like the text and sit behind it. So check the lightest patch behind white text, not the average colour of the photo.
Links inside a paragraph
1.4.1 Use of Color, at Level A, says colour can’t be the only way to show something. W3C technique G183 allows a link shown only by colour if the link has 3:1 against the text around it, and both colours still meet text contrast against the background. G183 is one way to meet 1.4.1, not a requirement. An underline meets it too, because colour is then no longer the only cue. G183 itself still suggests an underline or bold, because two dark colours at 3:1 can be hard to tell apart.
Highlighted (selected) text
The colours of selected text, which CSS sets with ::selection, are a grey area. Whether 1.4.3 and 1.4.11 cover them is an open W3C issue, raised in April 2024 and still open on 28 September 2026.
Non-text contrast: controls, icons and charts
WCAG 1.4.11 Non-text Contrast asks for 3:1 against adjacent colours, meaning the colours right next to the thing you’re checking. It covers two things: what you need to see to find a control and tell what state it’s in, and the parts of a graphic you need to understand it. It arrived in WCAG 2.1 at Level AA, so it’s newer than the text rules. The W3C’s word for icons and charts is graphical objects. My page on 1.4.11 Non-text Contrast goes through it component by component.
W3C’s non-text contrast guidance comes with worked pass and fail figures, and its focus ring example says a lot about the rule. The ring is a grey, #949494, on white, which the W3C gives as 3:1. I calculated it at 3.03:1, and the next grey lighter, #959595, comes out at 2.995:1 and fails. So the W3C’s own passing example is one step from failing.
Buttons, inputs and checkboxes
The part that needs 3:1 is whatever tells you the control is there and what state it’s in. For an input that’s usually the border, and a #767676 border on white is 4.54:1 in my calculation, comfortably over. A button with visible text or a contrasting icon doesn’t need a visible edge at all, because the text already shows you it’s there. So a pale button fill can pass, as long as the label meets the text rules.
Hover, selected and checked states
Whatever identifies the control, like its border or the check in a checkbox, has to keep 3:1 against the colours next to it in every state. 1.4.11 doesn’t ask the states to contrast with each other. But if a state like selected is shown only by a colour change, 1.4.1 Use of Color applies. Add a cue that isn’t colour, like a tick, an underline or a border, or make the two states at least 3:1 apart. Hover is looser. A hover tint doesn’t need 3:1 against the background, as long as the control keeps its own 3:1.
Focus indicators
Three rules deal with focus, and 1.4.11 supplies the contrast number for the first.
2.4.7 Focus Visible (AA) asks for a visible focus indicator. Under 1.4.11, one you’ve styled yourself needs 3:1 against the colours next to it. The browser’s default focus style is exempt, as long as you haven’t changed it.
2.4.11 Focus Not Obscured (Minimum) (AA), new in 2.2, is about other content, like a sticky header, hiding the focused control completely. It sets no contrast ratio.
2.4.13 Focus Appearance (AAA), also new in 2.2, asks for an indicator at least as big as a 2px outline around the control, with 3:1 between the same pixels when focused and unfocused.
A focus state shown only by a change of background inside the control falls outside 1.4.11, and the W3C says it fails 1.4.1. The W3C’s #949494 ring from above passes 1.4.11, but the W3C also says a ring that only just passes isn’t a good indicator unless it’s very thick.
Icons and charts
Icons and charts need 3:1 for the parts you need to read them, like the lines on a chart or the shape of an icon that has no label. The exception is when a particular look is essential to the information the graphic gives. A chart’s shapes don’t need 3:1 when labels and values on the chart give the same information, but that text has to meet the text ratios. On a gradient, test the least contrasting part of the graphic. If it’s under 3:1, imagine that part is invisible. If you can still understand the graphic, it passes.
What doesn’t need to meet contrast requirements
Four things have no contrast requirement.
Disabled controls. A control you can’t use, like a disabled button, has no contrast requirement. The W3C describes an inactive control as visible but not currently usable. A grey button that still responds to a click has to meet the rules.
Logos. Text in a logo or brand name, which WCAG calls a logotype, has no requirement. That covers the logo itself, not your brand colours used elsewhere. A low-contrast treatment you chose, like a greyed-out wall of client logos, isn’t exempt either. If the logo is also a link or a button, the W3C’s best practice is a version of it with enough contrast.
Decoration and pictures. Text that’s pure decoration, that nobody can see, or that happens to be in a photo, like a street sign, has no requirement. WCAG calls this incidental text. A headline you put on top of a photo isn’t part of the picture, so it needs the text ratios.
Unstyled browser controls. A control left in the browser’s default styling is exempt from non-text contrast. Once you change its styling, it isn’t, and its text still needs 4.5:1.
Choosing colours that pass
Picking colours that pass comes down to lightness.
Black or white text always reaches AA
I checked all 16,777,216 sRGB colours. Every one of them reaches at least 4.58:1 with black text or with white text, and 4.58 is the square root of 21. So any background colour can carry AA body text, as long as the text is black or white. AAA is harder. Only 61.4% of colours reach 7:1 with black or white, which leaves 6,482,445 colours that can’t carry AAA body text in either.
Black gives more contrast than white on 64.4% of colours. WCAG 2 and APCA don’t always agree on which is better, though. On a bright orange, my APCA article shows black text passing AAA while APCA scores white text higher.
Fixing a pair that fails
Change how light or dark one colour is and keep its hue. The ratio only tracks relative luminance, so a darker or lighter version of the same hue is the quickest way to pass. Don’t judge lightness by eye or by HSL. Yellow and blue at the same HSL lightness are 1.07:1 and 8.59:1 on white in my calculation.
On white, #767676 is the lightest grey body text can use, and #949494 the lightest grey for a border or icon. That’s the WCAG 2 limit. My APCA article scores #767676 text under the level APCA asks for body text. Once a colour pair passes, write its contrast ratio next to the token pair in your design system, so you only check it once.
How to check colour contrast
The W3C judges contrast on the colours you set, so the checks work from your CSS or design file:
Take both colours from the CSS or the design file. The W3C uses the colours from the code, not the smoothed pixels on screen.
Whenever you set a text colour, make sure that element or one of its parents sets a background colour, and the other way round. Setting one without the other is a failure. If no background is set, WCAG assumes white.
Check each state of a control against the colours next to it.
For text on a photo, check the part of the image most like the text.
If a colour or layer is semi-transparent, check the colour it blends to over its real background, not the token’s solid value. Only part of a semi-transparent colour shows, and the rest comes from what’s behind it.
Perception, my Figma plugin, checks text and icons against WCAG 2 AA and AAA on the canvas. W3C’s guidance on 1.4.3 also lists other contrast tools, for information only.
Is colour contrast a legal requirement?
Whether you have to meet the contrast rules depends on where you are and who you work for. The US rules name a WCAG version directly. The UK Regulations name WCAG but no version, and GOV.UK’s guidance names 2.2. EU law names no WCAG version, and the European standard for websites points to WCAG 2. This is what each source says, not legal advice.
Which WCAG version do you need?
W3C’s WCAG overview says later versions add new success criteria and don’t change existing ones, so the text contrast rules in WCAG are the same in 2.0, 2.1 and 2.2. The additions are 1.4.11 Non-text Contrast, which arrived in 2.1 at AA, and 2.4.13 Focus Appearance, which arrived in 2.2 at AAA. So a design that meets the contrast rules in 2.2 meets them in 2.0 and 2.1 too. The W3C published WCAG 2.2 on 5 October 2023 and updated it on 12 December 2024. The October 2023 version is also an international standard, ISO/IEC 40500:2025.
In the UK
The Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 cover public sector websites and apps. They ask for a site or app to be “perceivable, operable, understandable and robust”. A site or app is presumed to meet that if it meets WCAG’s Level A and AA success criteria, and the Regulations don’t name a version. GOV.UK’s guidance for public sector websites says a site or app meets the legal requirements if it meets WCAG 2.2 AA and publishes an accessibility statement. The Regulations don’t require it if meeting it would be a disproportionate burden.
Other organisations aren’t covered by those Regulations. But GOV.UK says all UK service providers have to make reasonable adjustments under the Equality Act 2010, or the Disability Discrimination Act 1995 in Northern Ireland.
In the EU
EU countries have had to apply the European Accessibility Act since 28 June 2025. The Act doesn’t name WCAG. If a product or service meets a harmonised standard listed in the EU’s Official Journal, it’s presumed to meet the Act’s accessibility requirements, as far as the standard covers them. For websites and apps, the European standard is EN 301 549, which also covers the EU’s rules for public sector sites. The European Commission’s AccessibleEU centre says its September 2026 version, v4.1.1, moves to WCAG 2.2, replacing WCAG 2.1, and will give a presumption of conformity with the Act once the Commission cites it in the Official Journal. Until then, the reference is still the 2021 version, v3.2.1.
In the US
The Department of Justice’s ADA Title II web rule makes WCAG 2.1 Level AA the standard for state and local government websites and apps. An interim final rule in April 2026 moved the compliance dates. Governments serving 50,000 people or more now have until 26 April 2027, and smaller ones and special district governments until 26 April 2028. Federal agencies follow the Section 508 standards, which still point to WCAG 2.0 Level A and AA.
What about WCAG 3 and APCA?
WCAG 3 won’t change what you design to this year. The latest WCAG 3 Working Draft, dated 10 September 2026, says its contrast algorithm is yet to be determined. My APCA article explains the method once proposed for WCAG 3, and shows the colour pairs where it and WCAG 2 disagree.
Every source in the section above that points to WCAG points to WCAG 2, so the three numbers on this page are still the ones to meet.
Sources
Primary sources, checked on 28 September 2026.
W3C, Web Content Accessibility Guidelines (WCAG) 2.2, 12 December 2024
GOV.UK, Accessibility requirements for public sector websites and apps
Directive (EU) 2019/882, the European Accessibility Act, Article 15
European Commission, AccessibleEU: EN 301 549 has been updated, 7 September 2026
Figures
The three WCAG 2 contrast numbers. From WCAG 2.2.
The lightest passing greys on white. My calculation with the WCAG 2.2 formula.
#767676and#777777on white. My calculation with the WCAG 2.2 formula.Which rule applies to each part of a form. From WCAG 2.2 and W3C’s Understanding 1.4.11. Measured on GOV.UK Frontend 5.14.0 in Chrome.
What’s exempt. From WCAG 2.2 and W3C’s Understanding 1.4.3.
Black or white text on every colour. My calculation over all 16,777,216 sRGB colours.
Greys that don’t reach 7:1 with black or white text. My calculation with the WCAG 2.2 formula.