Pa11y is an open-source automated accessibility testing tool that loads a web page in a headless browser, runs a rule engine against the rendered document and reports issues measured against the Web Content Accessibility Guidelines (WCAG). In web accessibility practice, it belongs to the family of scriptable checkers that developers run from the terminal, from Node.js code or from a continuous integration pipeline, rather than from a browser extension.
The name is a play on the numeronym a11y, where 11 stands for the letters between the first and last letter of accessibility. Pa11y is valued for being small, scriptable and free, but like every automated checker it detects only the machine-testable subset of WCAG failures and cannot replace manual review.
How Pa11y tests a page
Pa11y tests a page by rendering it in headless Chrome through Puppeteer, waiting until the document is ready and then injecting a test runner that inspects the live DOM. Because it evaluates the rendered page, it sees content added by JavaScript, computed styles and the final state of the document, not only the raw HTML returned by the server.
The default runner is HTML_CodeSniffer, a rule library that maps each check to a WCAG success criterion and technique code. Since version 5, Pa11y can also use axe-core as an alternative or additional runner, and results from both engines can be combined in one report. Each finding carries a rule code, a message, a CSS selector and an HTML context snippet, which lets a developer locate the offending element quickly.
The following table summarizes the stages of a typical Pa11y run and what each stage contributes.
| Stage | What happens | Why it matters |
|---|---|---|
| Launch | Puppeteer starts headless Chrome | Provides a real rendering engine |
| Navigate | The URL loads with optional headers and cookies | Allows testing of authenticated pages |
| Actions | Scripted clicks, typing or waits run | Reaches states such as open menus |
| Run rules | HTML_CodeSniffer or axe-core inspects the DOM | Applies WCAG-mapped checks |
| Report | Issues are formatted and returned | Feeds terminals, files or pipelines |
The Pa11y toolset and its components
Pa11y is not a single program but a small family of related packages maintained under the same project. The core package handles one URL at a time, while companion tools add batch testing, scheduling and visualization on top of it.
| Package | Primary role | Typical user |
|---|---|---|
| pa11y | Command-line tool and Node.js library for one page | Developer debugging a template |
| pa11y-ci | Tests lists of URLs or a sitemap with thresholds | Build engineer guarding releases |
| pa11y-dashboard | Web interface that tracks results over time | Team lead monitoring trends |
| pa11y-webservice | JSON API that schedules recurring tests | Platform team integrating tools |
In practice, pa11y-ci is the most common entry point for teams, because it reads a configuration file listing URLs, applies shared options and fails the build when the number of errors exceeds a configured threshold. The dashboard is useful for showing progress to stakeholders, although it requires its own database and hosting.
Key options, standards and result types
Pa11y behavior is controlled through command-line flags or a JSON configuration, and a handful of options decide most of what a team sees. The standard option selects WCAG2A, WCAG2AA or WCAG2AAA, with WCAG2AA as the default because level AA is the usual legal and contractual target.
| Option | Effect | Common setting |
|---|---|---|
| standard | Selects the WCAG conformance level | WCAG2AA |
| runner | Chooses the rule engine | htmlcs, axe or both |
| level | Sets which issue type fails the run | error |
| threshold | Tolerates a number of issues before failing | 0 for new projects |
| ignore | Excludes specific rule codes or types | Reviewed false positives |
| hideElements | Skips matching elements entirely | Third-party widgets |
| actions | Scripts interaction before testing | Open a dialog, fill a form |
| reporter | Formats output | cli, json, csv or html |
Every finding is classified as an error, a warning or a notice. Errors are failures the engine is confident about, such as an image without a text alternative. Warnings and notices require human judgment, for example whether a link text is meaningful in context. The command-line tool returns exit code 2 when issues are found and exit code 1 for technical failures, which makes scripting straightforward.
How Pa11y compares with other accessibility checkers
Pa11y occupies the headless, automation-first niche among accessibility tools. It overlaps heavily with axe-core, which it can embed, and with WAVE, which serves a similar purpose through a visual browser overlay.
| Tool | Interface | Strength | Limitation |
|---|---|---|---|
| Pa11y | CLI, Node.js API, CI | Simple scripting and batch runs | No visual in-page overlay |
| axe-core | JavaScript library | Low false-positive rate | Needs a host tool or framework |
| WAVE | Browser extension and API | Visual annotation of issues | Less suited to unattended runs |
| Lighthouse | DevTools panel and CLI | Combines performance and accessibility | Smaller accessibility rule set |
The engines also differ in philosophy. HTML_CodeSniffer reports more notices that ask a human to verify something, while axe-core deliberately limits itself to findings with very few false positives. Running both through Pa11y gives broader coverage at the cost of more triage work.
Using Pa11y in a development workflow
Pa11y delivers the most value when it runs automatically on every change, so regressions are caught before release instead of during an annual accessibility audit. A common pattern is to add pa11y-ci to the pipeline, point it at a sitemap or a curated list of representative templates and set the threshold to zero for new code.
- Test templates rather than every page, because one broken component usually repeats across hundreds of URLs.
- Use actions to reach hidden states, such as expanded navigation, modal dialogs and form error messages.
- Record ignored rules with a reason, so suppressions remain auditable and do not hide real defects.
- Store JSON results as build artifacts, which allows trend comparison between releases.
For legacy sites with hundreds of existing issues, teams often start with a baseline threshold equal to the current count and lower it gradually. This prevents the pipeline from failing permanently while still blocking new regressions.
Limitations and common mistakes
The central limitation is that automated testing covers only part of WCAG. Estimates vary by method, but automated engines typically detect a minority of real-world barriers, often cited as roughly a third of issues. A clean Pa11y report therefore means no detectable failures, not an accessible page.
| Mistake | Consequence | Better practice |
|---|---|---|
| Treating zero errors as conformance | Keyboard and screen reader barriers remain | Add manual and assistive technology testing |
| Ignoring warnings and notices | Context-dependent failures go unreviewed | Triage them during code review |
| Testing only the home page | Forms and checkout flows stay untested | Cover each template and key journey |
| Broad ignore rules | Real defects are silently suppressed | Ignore by specific code with a note |
| Skipping interactive states | Dialogs and menus escape testing | Script actions before the run |
Pa11y also cannot judge meaning and usability: it confirms that an image has alt text, not that the text describes the image, and it confirms that focus styles exist only indirectly. Focus management, tab order and reading order still require a person using a keyboard and a screen reader such as NVDA.
In plain words
Pa11y is a free program that visits a website on its own and checks it for common accessibility problems. It looks for things such as pictures without descriptions, form fields without labels and text that is too pale to read, and then prints a list of what it found.
Think of it as a spell checker for accessibility. It catches many obvious slips quickly and every time, but it cannot tell whether the writing actually makes sense. People still need to test the site the way disabled visitors really use it.
A real-world example
A regional public transport operator rebuilds its journey planner and must meet WCAG 2.1 level AA under its procurement contract. The development team adds pa11y-ci to its build pipeline with a list of twelve representative URLs, including the timetable search, the results page and the ticket checkout, each with scripted actions that open the date picker and submit an empty form.
On the first run, Pa11y reports 47 errors, most of them missing form labels in a shared search component and low-contrast text in the footer. Fixing those two components removes 38 errors across all pages in a single sprint. The team then sets the threshold to zero, so any new error fails the build automatically.
Before launch, an external auditor still finds keyboard traps in the map widget that Pa11y could not detect, which confirms that the tool reduced manual effort without replacing it.