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)

–
Ring vs component
–
Verdict at 3:1
–
Ring vs page
–
Verdict at 3:1
–
Indicator area
–
Required area (2 px perimeter)
–
Area verdict
–

Live preview

Focused button (your ring, your colors, your thickness)

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:

  1. 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.
  2. 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 colorRatio vs whiteVerdictWhat it means
#2563EB (blue-600)5.17:1PassA safe default focus-ring blue.
#1D4ED8 (blue-700)6.70:1PassDarker blue, even safer.
#000000 (black)21.00:1PassMaximum contrast — the fallback that always works.
#93C5FD (blue-300)1.80:1FailA light ring on white is nearly invisible.
#60A5FA (blue-400)2.54:1FailBright blue is not automatically visible on white.
#F59E0B (amber-500)2.15:1FailWarning 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…RatioVerdictWhat it means
#2563EB ring vs white page5.17:1PassAgainst the page, the ring is clearly visible.
#2563EB ring vs #1D4ED8 button1.30:1FailSame ring, same button family — invisible where it meets the control.
#2563EB ring vs #1F2937 button2.84:1FailBlue on dark gray misses by 0.16 — no rounding, 2.84 is a fail.
#93C5FD ring vs #2563EB button2.87:1FailA light ring on a blue button still falls short of 3:1.
#93C5FD ring vs white page1.80:1FailThe same light ring fails the page side too — it fails everywhere.
#FFFFFF ring vs #2563EB button5.17:1PassA white ring on the blue button passes — pair it with a dark outer ring for the page side.
#FFFFFF ring vs white page1.00:1FailThe mirror image: the white ring vanishes against the white page.
#2563EB ring vs #EFF6FF card4.75:1PassEven 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 colorvs #111827 pagevs #1F2937 buttonVerdict
#60A5FA (blue-400)6.98:15.77:1Pass / Pass
#93C5FD (blue-300)9.84:18.14:1Pass / Pass
#FBBF24 (amber-400)10.63:18.79:1Pass / Pass
#38BDF8 (sky-400)8.28:16.85:1Pass / Pass
#34D399 (emerald-400)9.23:17.64:1Pass / Pass
#FFFFFF (white)17.74:114.68:1Pass / Pass
#2563EB (blue-600)3.43:12.84:1Pass / 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.

ComponentRequired area1 px ring2 px ring3 px ring
120 × 40 button656 px²324 px² — Fail656 px² — Pass996 px² — Pass
32 × 32 icon button272 px²132 px² — Fail272 px² — Pass420 px² — Pass
200 × 48 button1,008 px²500 px² — Fail1,008 px² — Pass1,524 px² — Pass
100 × 36 input560 px²276 px² — Fail560 px² — Pass852 px² — Pass

How to fix a failing focus ring

  1. 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.
  2. 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).
  3. Make it at least 2 px thick. The browser default :focus-visible outline 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.
  4. Never remove the outline without a replacement. outline: none with 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.
  5. 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.