axe-core is an open-source JavaScript accessibility rules engine that runs inside a browser page, inspects the rendered DOM and reports elements that break WCAG success criteria or accessibility best practices. In web testing, it is the most widely embedded engine for automated accessibility checks, powering browser extensions, Lighthouse audits and test-framework plugins.
Developed by Deque Systems and released under the Mozilla Public License 2.0, axe-core is often called simply axe. Its design goal is no false positives: a rule reports a violation only when the engine is confident, and uncertain cases are flagged for human review instead.
How axe-core evaluates a page
axe-core works on the live, rendered document, not on source files. After the script is injected, a call to axe.run() walks the DOM, computes styles, accessible names and roles, and applies each enabled rule to the matching elements, including content inside open shadow roots and same-origin frames.
Each rule is built from checks grouped as any, all and none conditions. A rule such as color contrast selects text nodes, calculates foreground and background colors and compares the ratio with the 4.5:1 threshold for normal text. The engine then sorts every evaluated node into one of four result groups.
| Result group | Meaning | Recommended action |
|---|---|---|
| violations | Rule failed with high confidence | Fix the element and rerun the test |
| incomplete | Engine could not decide, for example text over an image | Review manually |
| passes | Rule was applied and the element met it | No action, useful as coverage evidence |
| inapplicable | No element matched the rule | No action needed |
The incomplete group is frequently ignored, which is a mistake. It often contains the contrast and ARIA cases that most need a human decision.
Rules, tags and impact levels
axe-core ships with roughly 90 to 100 rules, depending on the version, and each rule carries tags that map it to standards. Tags let teams run only the rules that match their compliance target.
| Tag | Scope | Typical use |
|---|---|---|
| wcag2a | WCAG 2.0 Level A | Minimum legal baseline |
| wcag2aa | WCAG 2.0 Level AA | Most regulatory targets |
| wcag21aa / wcag22aa | Criteria added in WCAG 2.1 and 2.2 | Current procurement requirements |
| best-practice | Guidance beyond WCAG | Quality checks such as landmark use |
| experimental | Rules still under evaluation | Disabled by default |
Every violation also has an impact level of minor, moderate, serious or critical. Impact describes the likely effect on users, for example a missing form label is usually critical, while it does not reflect legal priority. Many teams fail the build only on serious and critical issues at first and tighten the gate over time.
Integrations in the web testing stack
axe-core itself has no user interface and no test runner; it is a library that other tools wrap. This is why the same rules appear in very different places, from a developer’s browser to a continuous integration pipeline.
| Integration | Where it runs | Best suited for |
|---|---|---|
| Browser extension | Browser DevTools panel | Manual spot checks during development |
| Lighthouse | Chrome and PageSpeed Insights | Quick accessibility score with a subset of rules |
| Playwright or Puppeteer | Headless browser in end-to-end tests | Checking full user flows and page states |
| Cypress plugin | Cypress test runner | Component and page tests in one tool |
| jest-axe | Jest with a simulated DOM | Fast unit tests of components |
| Command-line tools | Node.js scripts | Crawling lists of URLs |
Unit tests in a simulated DOM have limits: jsdom does not compute layout, so rules that need rendering, especially color contrast, cannot run reliably there. End-to-end tests in a real browser engine give more complete results.
How axe-core compares with other accessibility checkers
axe-core is one of several engines used for accessibility testing, and the choice depends on how results are consumed. Its strength is embedding into code; other tools focus on visual reports or site crawling.
- WAVE overlays icons on the page, which suits visual review by content editors more than automated pipelines.
- Pa11y is a command-line runner that can use axe-core or HTML_CodeSniffer as its engine.
- Lighthouse runs a selected subset of axe-core rules and converts them into a weighted score, so a score of 100 does not mean the full rule set passed.
Configuring axe-core in practice
Effective use depends on scoping the analysis and handling exceptions deliberately. axe.run() accepts a context, such as a selector to include or exclude, and options that enable tags, disable rules or set result types.
- Run checks after each meaningful state change, such as opening a dialog or expanding a menu, because hidden content is not evaluated.
- Exclude third-party widgets only with a tracked ticket, so excluded areas are not forgotten.
- Pin the axe-core version in the lockfile, since new releases add rules and can break builds unexpectedly.
- Store results as JSON to track trends across releases rather than single runs.
Limitations and common misconceptions
The most important limitation is coverage: automated engines detect only a portion of WCAG failures, commonly estimated at around a third to a half of real-world issues depending on the method of counting. axe-core cannot judge whether alt text is meaningful, whether focus order is logical or whether a screen reader experience makes sense.
| Issue | Detected automatically | Reason |
|---|---|---|
| Missing form label | Yes | Absence of an accessible name is measurable |
| Insufficient contrast | Mostly | Images and gradients produce incomplete results |
| Meaningful alt text | No | Requires understanding of image purpose |
| Logical focus order | No | Depends on visual layout and user intent |
| Keyboard traps | No | Requires interaction, not static inspection |
A zero-violation result is not proof of accessibility. It shows that the tested states passed the automated rules, and it must be combined with keyboard testing and screen reader checks.
In plain words
axe-core is like a spell checker for accessibility. It reads a web page the way a browser sees it and points out problems that would make the page hard to use for people with disabilities, such as buttons without names or text that is too faint to read.
Like a spell checker, it catches many obvious mistakes but not all of them. It cannot tell whether a picture description actually makes sense, so people still need to test the page themselves.
A real-world example
A team building an online banking portal adds axe-core to its Playwright end-to-end tests. Each test logs in, opens the transfer form, triggers validation errors and runs an analysis with the wcag2a, wcag2aa and wcag22aa tags after every step.
In the first week the pipeline reports 37 violations, mostly unlabeled icon buttons and low-contrast error text. The team fixes the critical and serious ones within two sprints and then configures the build to fail on any new serious or critical violation. A quarterly manual audit with screen readers still finds focus-order problems the engine cannot detect, but the number of regressions reaching production drops sharply.