Acorn
A strong pick. 4th of 9 JavaScript parsers and codemods.
Acorn is a small, spec-accurate JavaScript parser written in JavaScript. It produces the standard ESTree tree and has no dependencies. It is still a solid pick for parsing plain JavaScript in pure JS. It cannot parse TypeScript without a plugin, it cannot print code back out, and Oxc and Babel now cover more of this category's job.
Best for: Tool authors who need a light, dependency-free ESTree parser for plain JavaScript that runs anywhere JS runs.
Scores
Overall7.1
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 6.5, likely 5.5 to 7.5
Acorn is a trusted, dependency-free and stable parser for plain JavaScript. For that narrow job it is still a good choice. For a new project in this category, the lack of TypeScript and of any code printing or transforms counts heavily against it. Oxc is faster and covers TypeScript, and Babel covers TypeScript and JSX. Its download growth is below the median, which shows the field moving away from it.
- github.com/oxc-project/bench-javascript-parser: Oxc beats it on speed and also parses TypeScript
- npm downloadsSame4WeeksYearAgo: Growth below the median
- github.com/acornjs/acorn/blob/master/acorn/CHANGELOG.md: Still maintained and current with the spec
GPT-6.2 Sol: 7.6, likely 6.5 to 8.6
Acorn is a strong pick for new tools that need fast, portable ESTree parsing of standard JavaScript. Babel parser and Oxc cover TypeScript and JSX in a single parser package, and Recast is a better fit when preserving formatting is central to the job. The recent release cadence and continued use by ESLint support the recommendation, while slower relative download growth and major bundlers moving away limit confidence in its future share.
- github.com/acornjs/acorn/blob/8.19.0/acorn/README.md: Stable typed ESTree parser with a small public API
- babeljs.io/docs/babel-parser: Babel covers a wider range of source syntax
- oxc.rs/docs/guide/usage/parser: Oxc supports JavaScript, JSX, TypeScript, and TSX
- github.com/benjamn/recast: Recast directly supports formatting-preserving rewrites
- github.com/eslint/js/blob/main/packages/espree/package.json: Continued use in ESLint's parser
- github.com/webpack/webpack/blob/main/CHANGELOG.md#51110: A major downstream tool moved to its own parser
- evidence.npm.versionsLastYear, evidence.npm.downloadsLast4Weeks, evidence.npm.downloadsSame4WeeksYearAgo, medianDownloadsRatio: Four releases in a year and below-baseline download growth
Needed by many4.4
How many developers need a tool for this job?
Claude Opus 5.5: 4.5, likely 3.0 to 6.0
Most developers use a parser only indirectly, through their build tools. Writing parser code directly is a task for tool and plugin authors. Acorn also covers only plain JavaScript and does no code changes, so it is narrower than this category, which includes TypeScript and codemods.
- github.com/acornjs/acorn: JS parser, error-tolerant loose parser and walker; no TS
- github.com/oxc-project/bench-javascript-parser: Acorn fails to parse the TypeScript test files
GPT-6.2 Sol: 4.3, likely 3.2 to 5.5
Acorn serves developers building linters, bundlers, editors, and code analyzers across runtimes. Build steps are common among State of JavaScript respondents, but the survey leaves the share of developers who select a parser directly unmeasured. Acorn's JavaScript focus further narrows its audience among teams working with TypeScript or JSX.
- 2025.stateofjs.com/en-US/usage: Build steps are common among respondents
- github.com/acornjs/acorn/blob/8.19.0/acorn/README.md: Documents standard JavaScript parsing and plugin-based extensions
- reddit.com/r/typescript/comments/1d4a911/ast_analysis_for_typescript_jsx: A developer used Acorn for JavaScript and sought separate TSX support
Helps a lot7.2
How well does it do the job for those who need it?
Claude Opus 5.5: 6.5, likely 5.5 to 7.5
For plain JavaScript it is correct, small and fast for a parser written in JS. It ships types, a walker and an error-tolerant parser. But it parses no TypeScript and prints no code. Oxc is several times faster, and Oxc and Babel both handle TypeScript and JSX without extra packages, so most new work today is better served elsewhere.
- github.com/oxc-project/bench-javascript-parser: Acorn is about as fast as Babel on JS, much slower than Oxc raw transfer, and fails on TS
- github.com/acornjs/acorn/blob/master/acorn/CHANGELOG.md: Steady fixes for spec correctness and support for new syntax
- github.com/sveltejs/acorn-typescript: TypeScript needs a third-party plugin
- npm hasTypes: Ships TypeScript types
GPT-6.2 Sol: 7.8, likely 6.7 to 8.8
Acorn 8.19.0 offers a small, well-documented API, typed ESTree nodes, and precise syntax errors. A benchmark from the Yuku team put it ahead of Babel and Oxc on two JavaScript inputs, while a user reported a JavaScriptCore slowdown, so speed depends on the workload and runtime. The API examples give coding agents a clear starting point, though agent accuracy is unmeasured. Babel covers TypeScript and JSX through bundled plugins, and Recast adds formatting-preserving output.
- github.com/acornjs/acorn/blob/8.19.0/acorn/README.md: Documents ESTree output, parser options, and error locations
- github.com/yuku-toolchain/ecmascript-parser-benchmark-js: Competing parser team measured full AST creation on Bun
- github.com/acornjs/acorn/issues/1472: User measured a slowdown specific to JavaScriptCore
- github.com/acornjs/acorn-jsx/issues/135: Open user report on JSX with the loose parser
- babeljs.io/docs/babel-parser: Bundled TypeScript and JSX plugins
- github.com/benjamn/recast: Reprints changed code while preserving surrounding formatting
Holds up over time7.2
Will it still be a good choice in two years?
Claude Opus 5.5: 7.0, likely 5.5 to 8.0
It is maintained and stable. There were 49 commits and 4 npm releases in the last year, only 15 issues are open, and 8.x has had no breaking changes in years. One long-time maintainer does most of the work and there is no visible funding. Some tools are moving away from it: Rollup now uses SWC, and Vite now uses Rolldown and Oxc. webpack, ESLint and Svelte still keep it in wide use.
- github commitsLastYear: 49 commits
- npm versionsLastYear: 4 releases, latest 8.19.0 in October 2026
- github openIssues: 15 open against 877 closed
- Rollup 4 switched to an SWC-based parser; Vite moved to Rolldown/Oxc: Some tools are moving away from it
GPT-6.2 Sol: 7.4, likely 6.2 to 8.5
Four npm releases and 49 repository commits in the past year show steady upkeep, with recent syntax fixes shipping within the 8.x series. Two maintainers answered an October performance report the same day, and a patch followed four days later. Webpack recently switched to its own parser, and Rollup had already moved away. Those departures and limited visibility into Acorn-specific funding and typical review times widen the range.
- evidence.npm.versionsLastYear, evidence.github.commitsLastYear, evidence.github.openIssues, evidence.github.openPullRequests: Four npm releases, 49 commits, 15 open issues, and one open pull request
- github.com/acornjs/acorn/blob/8.19.0/acorn/CHANGELOG.md: Recent 8.x releases add syntax support and fix parser edge cases
- github.com/acornjs/acorn/issues/1472: Two maintainers replied on October 17 and a patch followed on October 21
- github.com/sponsors/marijnh: Personal sponsorship is visible and Acorn's share is unclear
- github.com/webpack/webpack/blob/main/CHANGELOG.md#51110: Webpack 5.111.0 dropped Acorn as a runtime dependency
- rollupjs.org/migration: Rollup 4 switched parsers and removed Acorn configuration
Used widely7.4
How many use it, and is that growing?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
It has 1.35B downloads in 4 weeks and 1.1M dependent repos, but most of that comes through webpack, espree and other tools rather than direct choice. The 8,880 dependent packages show real direct use. Downloads grew 2.65x in a year, below the 4.1x median, while Oxc and Meriyah grew much faster. Acorn is losing share among new projects.
- npm downloadsLast4Weeks: 1.35B, up from 509M a year ago (ratio 2.65)
- medianDownloadsRatio: The median is 4.1, so Acorn is losing ground
- dependents: 1.12M repos and 8,880 packages
- peers Oxc parser: Grew from 5M to 403M downloads in a year
GPT-6.2 Sol: 7.2, likely 5.9 to 8.5
Ecosyste.ms found 1.12 million dependent repositories and 8,880 packages, fewer repositories than Babel parser or Esprima and more than Recast. Downloads rose from 509 million to 1.35 billion in four weeks, a 2.65× ratio that trails the 4.1× baseline and Babel parser's 3.84×. ESLint's Espree helps drive transitive installs, and the stars and two Bluesky posts cover the whole Acorn repository. The installed base is large, while the share attributable to deliberate new choices remains hard to estimate.
- evidence.dependents, peers: Large indexed dependent base, behind Babel parser and Esprima by repository count
- evidence.npm.downloadsLast4Weeks, evidence.npm.downloadsSame4WeeksYearAgo, medianDownloadsRatio, peers: 2.65× year over year against a 4.1× catalog baseline
- evidence.github.stars, evidence.bluesky.posts, peers: 11,479 repository stars and two Bluesky posts, versus Babel's 18 posts
- github.com/eslint/js/blob/main/packages/espree/package.json: Espree installs Acorn directly
- github.com/acornjs/acorn: Repository also contains the walker and loose parser
Vouched for8.0
Who stands behind it being good?
Claude Opus 5.5: 8.0, likely 7.0 to 9.0
Major tools build on it and use it in production every day. ESLint's default parser, espree, is an adapter over Acorn, and webpack and Svelte also rely on it. Oxc treats Acorn's output as its reference and counts any difference as a bug. Surveys and public user discussion of it are sparse.
- eslint.org/blog/2015/12/espree-3-alpha-1-released: ESLint built espree on top of Acorn
- docs.rs/crate/oxc_parser_napi/0.140.0/source/README.md: Oxc matches its output to Acorn's ESTree
- github.com/sveltejs/acorn-typescript: Svelte maintains an Acorn plugin
- webpack uses acorn for its JavaScript parser: Used in production by a major bundler
GPT-6.2 Sol: 8.0, likely 7.0 to 9.0
ESLint's Espree builds on Acorn, and MDX relies on it for JavaScript expressions and module syntax. Recast documents Acorn as a supported parser, and the Yuku team's benchmark shows competitive JavaScript parsing speed on its test machine. Acorn-specific satisfaction data is sparse, and webpack's recent move to its own parser reduces the weight of its past adoption.
- github.com/eslint/js/blob/main/packages/espree/package.json: Current Espree manifest uses Acorn
- mdxjs.com/docs/troubleshooting-mdx: MDX documents its use of Acorn for expressions and imports or exports
- github.com/benjamn/recast: Recast documents how to use Acorn as its parser
- github.com/yuku-toolchain/ecmascript-parser-benchmark-js: External measurements show competitive full-tree parsing
- github.com/webpack/webpack/blob/main/CHANGELOG.md#51110: Webpack replaced its direct Acorn dependency
Safe7.6
How safe is it to depend on?
Claude Opus 5.5: 8.0, likely 7.0 to 9.0
It has zero runtime dependencies and an MIT licence. Its only advisory, a ReDoS fixed in 2020, is old, and none came in the last 24 months. The OpenSSF Scorecard is 4.8. Weak spots include almost no code review, no security policy, no branch protection and unsigned releases, and very few people publish it.
- npm dependencies: 0 dependencies
- advisories: 1 advisory in total (2020 ReDoS), none in the last 24 months
- scorecard score: 4.8; weak Code-Review, Security-Policy and Branch-Protection
- npm license: MIT
GPT-6.2 Sol: 7.2, likely 6.0 to 8.4
The npm package has zero runtime dependencies and an MIT license. The sole recorded high-severity advisory was patched across three release lines, with fixes available before the GitHub advisory appeared and zero advisories recorded in the past 24 months. Scorecard gives Acorn 4.8 out of 10, with weak review and dependency pinning and zero scores for branch protection, a security policy, and fuzzing. The package lists three maintainers, while the publishing controls and signing status remain unverified.
- evidence.npm.dependencies, evidence.npm.license, evidence.advisories.last24Months: Zero runtime dependencies, MIT license, and zero recent advisories
- github.com/advisories/GHSA-6chw-6frg-f759: The 2020 denial-of-service advisory lists fixes for three release lines
- github.com/acornjs/acorn/blob/8.19.0/acorn/CHANGELOG.md: March 2020 entries document fixes before the April advisory
- evidence.scorecard.score, evidence.scorecard.checks: 4.8 overall, weak review and pinning, and signed releases unevaluated
- github.com/acornjs/acorn/blob/8.19.0/acorn/package.json: Release manifest lists three maintainers and declares MIT
Good
- It has zero dependencies, ships its own types, and has kept the same 8.x API without breaking changes for years.
- It tracks new ECMAScript syntax closely. Recent releases added `using`/`await using`, import attributes, Unicode 17 and 18, and `sourceType: "commonjs"`.
- Its ESTree output is the reference shape that other parsers copy. Oxc, for example, checks its output against Acorn's.
- Core tools are built on it, such as webpack, ESLint's espree and Svelte, so edge cases get found and fixed fast.
Bad
- It has no built-in TypeScript parsing. It fails on .ts files unless you add a third-party plugin such as @sveltejs/acorn-typescript.
- It only parses. To change code you need other tools to walk, transform and print the tree, such as acorn-walk, astring or magic-string.
- Rust-based Oxc parses several times faster and handles TypeScript and JSX in one package.
- Plugins hook into Acorn's internals, which the README itself warns can break them.
The numbers
- npm downloads, 4 weeks
- 1.3B ×2.7 in a year
- GitHub stars
- 11k
- Commits, 12 months
- 49
- npm version
- 8.19.0 Oct 2026
- Versions, 12 months
- 4
- Advisories, 24 months
- 0 of 1 ever
- OpenSSF Scorecard
- 4.8 out of 10, Nov 2026
- Licence
- MIT
Many packages install it, so most downloads are not a direct choice.
Read on 21 November 2026 from GitHub (acornjs/acorn), npm (acorn), OSV and the OpenSSF Scorecard.
JavaScript parsers and codemods
- 8.0Babel parser
- 7.8Oxc parser
- 7.5ast-grep
- 7.1Acorn
- 7.1Recast
- 7.0ts-morph
- 6.4jscodeshift
- 6.3Meriyah
- 2.4Esprima