The 2025 TestParty Guide to WCAG 2.4.13 – Focus Appearance (Level AAA)
Why did the focus indicator go to therapy? Because it had visibility issues and needed to work on its contrast! 🎯
WCAG 2.4.13 Focus Appearance ensures that when keyboard users navigate your site, the focus indicator is not just visible—it's prominent, high-contrast, and large enough to be easily perceived. This Level AAA criterion goes beyond basic visibility (covered in 2.4.7) to mandate specific size and contrast requirements that make focus indicators truly usable for people with low vision, cognitive disabilities, or anyone navigating by keyboard.
Table of Contents
- What WCAG 2.4.13 Requires
- Why This Matters
- Quick Implementation Guide
- Common Mistakes to Avoid
- How to Test for WCAG 2.4.13
- How TestParty Helps
- FAQs
What WCAG 2.4.13 Requires
When a user navigates to an interactive element using the keyboard (Tab, arrow keys, etc.), the focus indicator must meet both of these requirements:
Size requirement:
- The focus indicator area must be at least as large as a 2 CSS pixel thick perimeter around the unfocused component (or sub-component).
- Think of drawing a 2px border around a button—your focus indicator needs to cover at least that much area.
Contrast requirement:
- The pixels that change between focused and unfocused states must have a contrast ratio of at least 3:1.
- This is measured between the same pixels in both states—not against the background.
Key Exceptions
You're exempt from these requirements if:
- User agent default: The focus indicator is the browser's default (like Chrome's blue outline) and you haven't modified it.
- Unmodified background: You haven't changed the focus indicator or its background color from the user agent default.
What's Affected
This criterion applies to:
- All interactive components: buttons, links, form inputs, custom controls
- Sub-components within widgets: menu items, grid cells, tab panels, accordion headers
- Any element that can receive keyboard focus
The measurement is based on the visual presentation of the component—its content, border, and component-specific background. Shadows, glows, and effects outside the component boundary don't count.
Why This Matters
For users: People with low vision, attention deficits, or short-term memory challenges rely on prominent focus indicators to track where they are on a page. A thin, low-contrast outline can be invisible on certain backgrounds or easily lost during navigation. A robust focus indicator reduces cognitive load and prevents users from getting disoriented.
For compliance: While 2.4.13 is Level AAA (not legally required under most ADA interpretations), it represents best practice. Organizations pursuing AAA compliance—government agencies, educational institutions, healthcare providers—must meet this standard. The European Accessibility Act and EN 301 549 increasingly reference AAA criteria for public sector bodies. Even if you're targeting Level AA, implementing strong focus indicators improves usability for everyone and future-proofs your design.
For business: Strong focus indicators reduce support tickets ("Where am I on the page?"), improve conversion rates for keyboard users, and demonstrate a commitment to inclusive design. They're also easier to maintain than subtle, context-dependent indicators that break when designs change.
Quick Implementation Guide
1. Use a thick, high-contrast outline
The simplest approach is a solid outline that meets both size and contrast requirements:
/* Good: 2px solid outline with 3:1 contrast against component */
button:focus,
a:focus,
input:focus {
outline: 2px solid #0066CC; /* Dark blue */
outline-offset: 2px;
}
/* Even better: Two-color indicator for universal contrast */
button:focus,
a:focus,
input:focus {
outline: 2px solid #000;
outline-offset: 1px;
box-shadow: 0 0 0 4px #FFF, 0 0 0 6px #000;
}The two-color approach (black and white rings) ensures 3:1 contrast against any background color.
2. Calculate the perimeter area
For a button that's 120px × 40px, a 2px perimeter covers:
- Top and bottom: 2 × 120px × 2px = 480px²
- Left and right: 2 × 40px × 2px = 160px²
- Total: 640px² minimum
Your focus indicator must cover at least this area. A 2px outline naturally meets this; a 4px outline on one side also works.
3. Ensure 3:1 contrast between states
Measure the contrast between the same pixels when focused vs. unfocused. If your button has a white background when unfocused and a blue outline appears on focus, compare the blue outline pixels to the white they replaced.
Use the WebAIM Contrast Checker or browser DevTools to verify.
4. Test with real keyboard navigation
Tab through your interface. Can you always see where focus is? Does the indicator remain visible over images, gradients, and colored backgrounds?
5. Reference WCAG techniques
- G195: Using an author-supplied, visible focus indicator
- C40: Creating a two-color focus indicator for universal contrast
- C41: Creating a strong focus indicator within the component
Common Mistakes to Avoid
Thin or low-contrast outlines:
- A 1px dotted outline doesn't meet the size requirement.
- A light gray outline on a white button fails the 3:1 contrast test.
Removing focus indicators entirely:
outline: none;without a replacement violates multiple WCAG criteria (2.4.7, 2.4.13, and potentially 2.1.1).- This is Failure F78: styling outlines in a way that renders the focus indicator non-visible.
Using only background color changes:
- Changing a button's background from white to light blue may not provide 3:1 contrast between states.
- You need a distinct indicator—an outline, border, or underline.
Scripting away focus:
- Calling
blur()on focus or using JavaScript to suppress focus indicators is Failure F55 and breaks keyboard navigation entirely.
Assuming browser defaults are enough:
- Browser defaults often meet 2.4.7 (basic visibility) but may not meet 2.4.13's stricter size/contrast requirements.
- If you're targeting AAA, you need custom indicators.
How to Test for WCAG 2.4.13
Automated checks:
- Presence detection: Tools can flag missing focus indicators (
:focusstyles). - Contrast calculation: Automated scanners can measure contrast ratios between focused and unfocused states.
- Size estimation: Some tools can calculate perimeter area and compare it to the indicator size.
Manual checks required:
- Visual inspection: Tab through the interface and verify the indicator is always visible and prominent.
- Perimeter measurement: Use browser DevTools to measure component dimensions and calculate the 2px perimeter area. Compare to the actual indicator size.
- Contrast verification: Use a color picker to sample pixels in both states and verify 3:1 contrast.
- Sub-component testing: Open dropdowns, grids, and complex widgets. Verify focus indicators on menu items, cells, and nested controls.
Testing checklist:
- [ ] Focus indicator is visible on all interactive elements
- [ ] Indicator area ≥ 2px perimeter of the component
- [ ] Contrast between focused/unfocused states ≥ 3:1
- [ ] Indicator remains visible over all backgrounds (images, gradients, colors)
- [ ] No use of
outline: none;without a robust replacement - [ ] No JavaScript removing focus on interaction
How TestParty Helps
TestParty's AI-powered platform automates the detection, remediation, and monitoring of focus appearance issues—turning a complex, manual AAA requirement into a scalable, enforceable standard.
What TestParty detects:
Missing or suppressed focus indicators:
- Scans CSS for
outline: none;,outline: 0;, or:focus { outline: none; }without replacement styles. - Flags elements with
tabindexbut no visible focus state. - Detects JavaScript that calls
.blur()or otherwise suppresses focus programmatically (Failure F55).
Insufficient size:
- Calculates the 2px perimeter area for each focusable component based on its rendered dimensions.
- Measures the actual focus indicator area (outline width, border changes, box-shadow spread).
- Flags indicators that don't meet the minimum size threshold.
Low contrast between states:
- Samples pixel colors in both focused and unfocused states.
- Calculates the contrast ratio between the same pixels across states.
- Flags indicators with less than 3:1 contrast, even if they're visible to sighted users.
Context-specific failures:
- Tests focus indicators over various backgrounds (images, gradients, colored sections).
- Identifies cases where an indicator is visible on white backgrounds but disappears over photos or dark sections.
How TestParty suggests fixes:
Auto-generated CSS for robust focus indicators:
- TestParty generates code snippets for two-color focus indicators (C40) that work on any background:
``css *:focus { outline: 2px solid #000; outline-offset: 2px; box-shadow: 0 0 0 4px #FFF; } ``
- Suggests component-specific styles for buttons, links, and form controls that match your design system while meeting 2.4.13.
Perimeter-aware recommendations:
- For custom components, TestParty calculates the required perimeter area and suggests outline widths or box-shadow spreads that meet the threshold.
- Example: "This button requires a focus indicator covering at least 560px². A 2px outline provides 580px²—compliant."
Contrast-optimized palettes:
- When your brand colors don't provide 3:1 contrast, TestParty suggests adjusted shades or two-color combinations that maintain brand identity while meeting the standard.
Script remediation:
- Flags and suggests removal of
blur()calls or focus-suppressing event handlers. - Provides alternative patterns (like managing focus within modals) that don't violate 2.4.13.
All suggestions are reviewed by your team or TestParty accessibility specialists before being committed—ensuring fixes align with your design system and user experience goals.
Developer workflow integration:
CI/CD enforcement:
- TestParty integrates into your build pipeline, blocking merges that introduce focus indicator regressions.
- Pre-commit hooks flag new instances of
outline: none;without replacements.
Pull request annotations:
- Line-level comments in GitHub, GitLab, or Bitbucket PRs highlight focus indicator issues with suggested fixes.
- Example: "Line 47:
outline: none;on:focusviolates WCAG 2.4.13. Suggested fix: Addoutline: 2px solid #0066CC;"
Real-time IDE feedback:
- TestParty's IDE extensions (VS Code, WebStorm) underline problematic CSS as you type.
- Hover tooltips explain the 2.4.13 requirement and offer code snippets.
Template-level fixes:
- For sites built on Shopify, WordPress, or component libraries, TestParty applies focus indicator styles at the theme or component level—fixing thousands of pages with a single change.
Ongoing monitoring:
Regression prevention:
- TestParty continuously scans production sites for new focus indicator issues introduced by design updates, third-party scripts, or CMS changes.
- Alerts your team when a deployment degrades focus appearance compliance.
Compliance dashboards:
- Track 2.4.13 compliance across your site over time.
- Filter by component type (buttons, links, form fields) to identify patterns.
- Generate audit-ready reports showing AAA compliance status for procurement or legal reviews.
Sub-component tracking:
- TestParty maps focus indicators for complex widgets (dropdowns, grids, carousels) and tracks compliance at the sub-component level.
- Ensures menu items, grid cells, and nested controls all meet 2.4.13.
Because 2.4.13 is a Level AAA criterion with precise measurement requirements, TestParty's automated perimeter calculation and contrast analysis save hours of manual testing—while its human-reviewed remediation ensures fixes are both compliant and visually polished.
Some TestParty features described in this article are currently under development. Visit TestParty.ai to learn more about our current capabilities and roadmap, or book a demo at TestParty.ai/book-a-demo to see TestParty in action.
Disclaimer: Some of this article was generated with Large Language Models (LLMs) and Artificial Intelligence (AI). There may be some errors and we advise you to consult with human professionals for detailed questions.
FAQs About WCAG 2.4.13
What is WCAG 2.4.13 in plain language?
WCAG 2.4.13 requires that keyboard focus indicators be large and high-contrast enough to be easily seen. Specifically, the indicator must cover an area at least as large as a 2-pixel border around the element, and the contrast between focused and unfocused states must be at least 3:1. This ensures users with low vision or cognitive disabilities can always track where they are on the page.
Is WCAG 2.4.13 required for ADA compliance?
No, 2.4.13 is a Level AAA criterion and is not required for ADA compliance, which typically references Level AA. However, it represents best practice and is often required for government contracts, educational institutions, and organizations pursuing the highest accessibility standards. Implementing 2.4.13 also helps you meet Level AA criteria like 2.4.7 (Focus Visible) more robustly.
What's the difference between 2.4.7 Focus Visible and 2.4.13 Focus Appearance?
2.4.7 (Level AA) requires that a focus indicator be visible—users must be able to see where focus is. 2.4.13 (Level AAA) adds specific size and contrast requirements: the indicator must be at least as large as a 2px perimeter and have 3:1 contrast between states. Think of 2.4.7 as "is there an indicator?" and 2.4.13 as "is it prominent enough?"
Can I use the browser's default focus indicator for 2.4.13?
Yes, but only if you don't modify it. If the focus indicator is entirely determined by the user agent (browser) and you haven't changed the indicator or its background color, you're exempt from 2.4.13's size and contrast requirements. However, most modern designs customize focus styles, which means you must meet the full standard.
How do I calculate the 2px perimeter area?
Measure the width and height of your component in CSS pixels. The perimeter area is: 2 × (width + height) × 2px. For example, a 100px × 40px button has a perimeter area of 2 × (100 + 40) × 2 = 560px². Your focus indicator must cover at least this much area. A 2px outline around the entire button naturally meets this; a 4px outline on two sides also works.
Do shadows and glows count toward the focus indicator size?
Only if they're part of the component's visual presentation. Shadows and glows outside the component's content, border, and background don't count. However, a box-shadow used as an outline (e.g., box-shadow: 0 0 0 2px blue;) does count, because it's functioning as the focus indicator itself, not a decorative effect beyond the component boundary.
Stay informed
Accessibility insights delivered
straight to your inbox.


Automate the software work for accessibility compliance, end-to-end.
Empowering businesses with seamless digital accessibility solutions—simple, inclusive, effective.
Book a Demo