By Tim King · Updated
Tab Order Tester
Keyboard Focus Order Checked Against WCAG 2.4.3, With Unnamed Stops Flagged
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Tab Order Tester works
This tab order tester lists the order keyboard focus moves in. Paste the HTML of a page, a form or a component and the table lists each Tab stop in the order
the keyboard reaches it, what the screen reader will call it, and any tabindex value. A
second list shows focusable elements that are skipped and why: disabled, hidden, negative
tabindex or a link with no href. Problems such as positive tabindex and unnamed controls are
counted in the stats.
Tab order tester: tabindex and DOM order
Keyboard users move through a page with the Tab key, and where focus goes next is decided by
two things: the order elements appear in the source and any tabindex attributes. Sighted
mouse users never notice this order, which is why it so often goes wrong when a layout is
rearranged with CSS or a widget is built from <div> elements.
What is focusable. Links with an href, buttons, form fields, <summary>, <iframe>,
media with controls, editable regions and anything with a tabindex attribute. A link
without href, a disabled field, an element inside hidden or display: none, and anything
with tabindex="-1" is not in the sequence. The tool applies these rules to the pasted markup;
it cannot see styles from external stylesheets, so a control hidden by a class will appear
here although it would be skipped in the browser.
Sequence. Elements with a positive tabindex come first, in numeric order, before every
element with tabindex="0" or no tabindex, which then follow source order. That is why
positive values are almost always a mistake: a single tabindex="1" on a search box sends
focus there before the skip link and the navigation, and every later addition to the page has
to be renumbered. WCAG 2.4.3 requires that focus order preserves meaning, and source order that
matches the visual order is the only reliable way to achieve that.
Names. Each Tab stop is announced with its accessible name, which the tool derives from
aria-label, aria-labelledby, an associated <label>, the value of a submit button, the
alt text of a contained image, or the text content. A stop with no name, such as an icon
button, is announced as just "button". A field whose only name is its placeholder is flagged
too, since placeholders vanish when typing starts.
Generic elements. A <div tabindex="0"> is reachable but announces nothing about what it
is or how to use it. Focusable generic elements without a role are flagged; the fix is usually
to use a <button> instead, or to add the correct role and keyboard handling.
aria-hidden traps. An element with aria-hidden="true" that is still focusable creates a
ghost stop: the keyboard lands on it but the screen reader says nothing. The tool lists these
separately as an issue.
FAQ
Why is a control that is visible on my page listed as not in the tab order?
Check the reason column. Usually it is a link without href, an element with
tabindex="-1", or an ancestor with the hidden attribute or an inline display: none. If
the reason is "hidden" but the element is visible in your browser, a script is probably
revealing it at runtime.
The tool says the order is fine but focus jumps around visually.
Focus order is source order, so the problem is CSS: flexbox order, flex-direction: row-reverse, grid placement or absolute positioning moves things visually without moving
them in the sequence. Reorder the markup rather than adding tabindex values.
Should I remove every tabindex attribute?
Remove positive ones. tabindex="0" is correct on custom widgets that must be reachable, and
tabindex="-1" is correct on containers that scripts focus, such as a dialog or an error
summary, and on the inactive tabs of a roving-tabindex pattern.
Does it handle Shadow DOM and web components?
No. Shadow trees are not present in pasted HTML, so a custom element appears as a single non-focusable node. Test those in the browser with the Tab key and a screen reader.
See also: all Accessibility tools, Dev Utilities, Formatters & Validators, Data & Encoding, Security & Identifiers, SEO, AI.
Related tools
Skip Link Generator
Generate a skip-to-content link that appears on focus, with HTML and CSS.
Touch Target Checker
Check a control's size and spacing against WCAG, Apple and Android minimums.
0–60 Calculator
0–60 mph, 0–100 km/h and quarter mile from power and weight.
1920s Name Generator
Jazz Age names, from Chester Vanderbeck III to Millie Kowalski the flapper.
1940s Name Generator
Popular girls' and boys' names from the 1940s, US and UK.