Focus Indicator Contrast Checker
A visible focus ring is how keyboard users know where they are. WCAG 2.2 Success Criterion 2.4.13 Focus Appearance (AA) asks two things of it: at least 3:1 against both adjacent colors — the component it surrounds and the page behind it — and an area at least as large as a 2 CSS pixel thick perimeter of the component. Enter your ring, your component, and your page, and see whether the ring actually shows up.
Result — WCAG 2.2 Focus Appearance (2.4.13)
Live preview
The preview shows the ring exactly as entered — thickness included. If you can barely see it here, keyboard users will barely see it on your site.
The two rules of WCAG 2.4.13
Focus Appearance (WCAG 2.2, level AA) has a color rule and an area rule, and a ring must pass both:
- Color — 3:1 against adjacent colors. The indicator must reach 3:1 against every color it touches. A focus ring touches two: the component it surrounds and the page behind it. Checking only one side is the most common way a "passing" ring ships broken.
- Area — at least a 2 px perimeter. The indicator must cover an area at least as large as a 2 CSS pixel thick band around the component. For a W × H component that is 4(W+H) + 16 px². A 2 px outline lands exactly on that number; a 1 px outline always falls short, however large the component.
Note the threshold is inclusive: exactly 3.00:1 passes, and exactly the required area passes. This tool checks color only against the two colors you enter and area only for a rectangular component with the ring hugging it (outline-offset 0 — the conservative case; an offset ring covers more area, not less).
Focus rings on white
On a white page with a white button, the two checks collapse into one number — and the usual suspects fail it.
| Ring color | Ratio vs white | Verdict | What it means |
|---|---|---|---|
| #2563EB (blue-600) | 5.17:1 | Pass | A safe default focus-ring blue. |
| #1D4ED8 (blue-700) | 6.70:1 | Pass | Darker blue, even safer. |
| #000000 (black) | 21.00:1 | Pass | Maximum contrast — the fallback that always works. |
| #93C5FD (blue-300) | 1.80:1 | Fail | A light ring on white is nearly invisible. |
| #60A5FA (blue-400) | 2.54:1 | Fail | Bright blue is not automatically visible on white. |
| #F59E0B (amber-500) | 2.15:1 | Fail | Warning amber needs a darker shade on white. |
The blue-button trap
The classic failure is a blue ring on a blue button: it passes against the page and vanishes against the control. The same ring can pass one side and fail the other in either direction — the white ring is the mirror image.
| Ring vs… | Ratio | Verdict | What it means |
|---|---|---|---|
| #2563EB ring vs white page | 5.17:1 | Pass | Against the page, the ring is clearly visible. |
| #2563EB ring vs #1D4ED8 button | 1.30:1 | Fail | Same ring, same button family — invisible where it meets the control. |
| #2563EB ring vs #1F2937 button | 2.84:1 | Fail | Blue on dark gray misses by 0.16 — no rounding, 2.84 is a fail. |
| #93C5FD ring vs #2563EB button | 2.87:1 | Fail | A light ring on a blue button still falls short of 3:1. |
| #93C5FD ring vs white page | 1.80:1 | Fail | The same light ring fails the page side too — it fails everywhere. |
| #FFFFFF ring vs #2563EB button | 5.17:1 | Pass | A white ring on the blue button passes — pair it with a dark outer ring for the page side. |
| #FFFFFF ring vs white page | 1.00:1 | Fail | The mirror image: the white ring vanishes against the white page. |
| #2563EB ring vs #EFF6FF card | 4.75:1 | Pass | Even on a pale blue card the ring holds up. |
Dark mode: the same rings, the opposite verdicts
Contrast is always relative. The light rings that fail on white pass easily on dark — and the blue ring that passes on white fails against a dark button.
| Ring color | vs #111827 page | vs #1F2937 button | Verdict |
|---|---|---|---|
| #60A5FA (blue-400) | 6.98:1 | 5.77:1 | Pass / Pass |
| #93C5FD (blue-300) | 9.84:1 | 8.14:1 | Pass / Pass |
| #FBBF24 (amber-400) | 10.63:1 | 8.79:1 | Pass / Pass |
| #38BDF8 (sky-400) | 8.28:1 | 6.85:1 | Pass / Pass |
| #34D399 (emerald-400) | 9.23:1 | 7.64:1 | Pass / Pass |
| #FFFFFF (white) | 17.74:1 | 14.68:1 | Pass / Pass |
| #2563EB (blue-600) | 3.43:1 | 2.84:1 | Pass / Fail |
The last row is the trap in reverse: the standard blue ring passes the dark page (3.43) but fails the dark button (2.84). In dark mode, reach for the lighter blues — #60A5FA and #93C5FD both pass on both sides.
The area rule, in numbers
Required area = 4(W+H) + 16 px². A 2 px outline always lands exactly on it; a 1 px outline always falls short; 3 px clears it with room to spare. The thickness rule is really an "at least 2 px" rule, stated as an area so non-rectangular indicators can be judged the same way.
| Component | Required area | 1 px ring | 2 px ring | 3 px ring |
|---|---|---|---|---|
| 120 × 40 button | 656 px² | 324 px² — Fail | 656 px² — Pass | 996 px² — Pass |
| 32 × 32 icon button | 272 px² | 132 px² — Fail | 272 px² — Pass | 420 px² — Pass |
| 200 × 48 button | 1,008 px² | 500 px² — Fail | 1,008 px² — Pass | 1,524 px² — Pass |
| 100 × 36 input | 560 px² | 276 px² — Fail | 560 px² — Pass | 852 px² — Pass |
How to fix a failing focus ring
- Use a double ring. A white inner ring plus a dark outer ring (or the reverse) — one of the two always contrasts with whatever sits on either side. It is the only fix that works no matter what the button and page colors are.
- Go one shade darker on light pages, one shade lighter on dark pages. #60A5FA → #2563EB on white (2.54 → 5.17); #2563EB → #60A5FA on dark (2.84 → 5.77 against a dark button).
- Make it at least 2 px thick. The browser default
:focus-visibleoutline is usually 2 px — if your design system thins it to 1 px for looks, it fails the area rule even with a perfect color. - Never remove the outline without a replacement.
outline: nonewith no custom indicator is not a style choice; it removes the only way keyboard users can see where they are. If you restyle focus, replace it with something that passes this check. - Check the real adjacent colors. A ring that passes on the page can fail on a tinted card or a colored button — run the check with the component's actual fill, not an assumed white.
How the math works
Color: the standard WCAG 2.1 ratio — relative luminance from linearized sRGB (weights 0.2126 red, 0.7152 green, 0.0722 blue), then (L1 + 0.05) / (L2 + 0.05) — checked twice, once per neighbor, against the 3:1 line. Area: a t px outline around a W × H rectangle covers (W+2t)(H+2t) − W×H = 2t(W+H) + 4t² px²; the required area is that formula at t = 2. No uploads, no tracking: it all runs in your browser. For the 3:1 rule on icons and borders generally, see the non-text contrast checker; for link colors, the link text checker.
FAQ
Is this the same as WCAG 1.4.11 non-text contrast?
No. WCAG 2.1 Success Criterion 1.4.11 only asks for 3:1 against adjacent colors. WCAG 2.2 Success Criterion 2.4.13 Focus Appearance keeps the 3:1 rule and adds an area rule: the indicator must cover at least as much area as a 2 CSS pixel thick perimeter of the component. A ring can pass 1.4.11 on color and still fail 2.4.13 on thickness — check both with the non-text contrast checker if you only need the color side.
My browser already draws a focus outline — do I need to check it?
Yes. Browser defaults vary — usually a 2 px outline, but the color depends on the browser and operating system (often blue, sometimes black). And many sites remove the default with outline: none, which leaves keyboard users with no visible focus at all. Check the color your users actually see.
What if my focus ring is offset from the component?
An offset ring covers more area, not less, so the area rule gets easier — this tool assumes offset 0, the conservative case. The gap between component and ring is page-colored, so the ring still needs 3:1 against the page. Checking both neighbors, as this tool does, never hurts.
Does the ring need 3:1 against the text inside the button?
No. The focus indicator is only measured against its adjacent colors — the component fill and the page. Text contrast is a separate rule, WCAG 1.4.3 (4.5:1 for normal text), covered by the contrast checker.
What is Focus Not Obscured (WCAG 2.4.11)?
A separate WCAG 2.2 criterion: when a component receives keyboard focus, at least part of it must stay visible — a sticky header or overlay must not cover it entirely. It is not a color or area number, so no calculator can test it: tab through the page and look.
Is my color data uploaded anywhere?
No. Everything runs locally in your browser; no colors, no analytics, no tracking.