Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Babel (JavaScript)

Rewrite new JavaScript for older browsers.

Build tools and bundlersNPM

GitHubWebsite

1. License

“Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction”

MIT allows use in paid and closed-source products.

github.com/babel/babel/blob/main/LICENSE

From the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error

What Babel (JavaScript) does

Babel is a free tool that rewrites JavaScript before it ships. It turns newer code, React's JSX tags and TypeScript into plain JavaScript that the browsers you choose can run. Most people never call it directly; a build or test tool runs it for them.

What people build with it

Support older phones and browsers

Your shop still has visitors on older iPhones; Babel rewrites newer code such as ?. and ?? so their browsers can run it.

TypeScript and JSX without the TypeScript compiler

A React component written in TypeScript becomes plain JavaScript in one step. Types are removed, not checked, so the build stays quick.

Run user code in a playground

A coding lesson site or an online sandbox compiles what visitors type, right in their browser, with no server.

Clean up code across a project

Remove every leftover debug print, rename an old function everywhere, or change an import style in hundreds of files with one small rule.

List what a file imports

A script reads each source file as a tree and reports which packages it imports, for a cleanup or a security review.

New React features in an existing build Idea

Tools such as the React Compiler ship as Babel plugins, so a project that already uses Babel adds them with one config line.

Babel (JavaScript) popularity

84 / 100
Gid Score, #47 overall
271M
downloads a week, npm
44.1K
GitHub stars
230
agent projects use it
Babel (JavaScript): downloads per weeknpm, @babel/core 270,859,571
Babel (JavaScript): GitHub starsbabel/babel 44,074

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Babel (JavaScript) is used

  • Babel (JavaScript) is a dependency in 230 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (4.7% of the 4,867 JavaScript/TypeScript ones), #4 of 185 in build tools and bundlers.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 749; those are left out of every share on this page.
  • The most used alternative in our scan is esbuild (310 projects).
  • Projects that use it most often also use Jest (43.9%), React (73.5%), ESLint (71.7%).
  • It is more common in projects set up for OpenCode (5.5%) than for OpenClaw (2.4%).

By coding agent

112 projects, 4.6%
108 projects, 3.3%
98 projects, 3.2%
22 projects, 4.7%
19 projects, 5.5%
12 projects, 2.5%
11 projects, 3.9%
8 projects, 2.4%

Often used with

In 43.9% of its projects
In 73.5% of its projects
In 71.7% of its projects
In 34.3% of its projects
In 36.5% of its projects
In 83.0% of its projects
In 30.9% of its projects
In 30.9% of its projects

Babel (JavaScript) in practice

Strengths

New syntax in, supported syntax out

You write current JavaScript and Babel rewrites the features your targets lack into code they can run. The README shows ES2020 nullish coalescing turned into a plain <code>!= null</code> check.

Babel can compile TypeScript while tsc only type-checks

With <code>@babel/preset-typescript</code>, Artsy let Babel produce the JavaScript and kept <code>tsc</code> only for type-checking. Their summary of the result: "Proper type-checking, but compilation handled by Babel".

One scope for every package

Since Babel 7, the core, presets and plugins all live in one monorepo and are published as <code>@babel/*</code> packages, such as <code>@babel/core</code> and <code>@babel/preset-react</code>.

Fixes still land in the 8.x line

The v8.0.7 release fixes bugs across the parser, traverse, helpers and several transform plugins. It also welcomes four first-time contributors.

Watch out for

Config takes ongoing work

Artsy's engineers warn that Babel setups take time to build and maintain. They also say some options can make interop with other environments hard.

Some TypeScript features are out of reach

Artsy quotes the TypeScript plugin's README: namespaces and const enums are not supported because they need type information. <code>export =</code> and <code>import =</code> are not supported either. The post dates from the Babel 7 beta.

TypeScript and Flow plugins cannot be loaded together

This causes trouble when a dependency or preset turns on the Flow plugin. Artsy says the only fix is to drop that preset or patch the code that loads the plugin.

Nullish coalescing, before and after Babel

// ES2020 nullish coalescing
function greet(input) {
  return input ?? "Hello world";
}

function greet(input) {
  return input != null ? input : "Hello world";
}

More about Babel (JavaScript)

Funding
  • GitHub Sponsors: https://github.com/babel
  • Open Collective: https://opencollective.com/babel
  • 38 GitHub sponsors

See all

Head to head
Packages around it
  • @babel/preset-env: Picks transforms for your targets
  • @babel/preset-react: JSX and React preset
  • @babel/preset-typescript: Compiles TypeScript
  • @babel/runtime: Shared runtime helpers
  • @babel/eslint-parser: Lets ESLint read Babel syntax
  • @babel/parser: Babel's JavaScript parser
More in Build tools and bundlers

Alternatives

Babel (JavaScript) This page

MITGid 84271M/wk

esbuild

Pick esbuild when you mostly need fast bundling and shrinking and do not need Babel's plugin system.

MITGid 85443M/wk

SWC

Pick SWC for a much faster compiler written in Rust that covers the common TypeScript and JSX cases.

Apache-2.0Gid 7861.9M/wk

Vite

Pick Vite for a whole dev server and build setup where you rarely touch the compiler yourself.

webpack

Module bundler that packages JavaScript, assets and dependencies for browser deployment.

MITGid 8376.9M/wk

Compare Babel (JavaScript) with another tool

Get started

Tell your AI assistant

“Set up Babel 8 (@babel/core 8.1.0 with @babel/preset-env, @babel/preset-react with runtime automatic and @babel/preset-typescript, Node.js 22.18+) with a top-level targets option, and keep tsc --noEmit for type checking.”

  1. Install the core, the command-line tool and the main preset as development packages.

    npm install --save-dev @babel/core @babel/cli @babel/preset-env

    From babeljs.io/docs/usage

  2. Say which browsers you support. Without it, Babel 8 uses the browserslist "defaults" list (Babel 7 compiled for all browsers).

    { "targets": "defaults", "presets": ["@babel/preset-env"] }
    

    From babeljs.io/docs/v8-migration

  3. Compile the src folder into lib.

    ./node_modules/.bin/babel src --out-dir lib

    From babeljs.io/docs/usage

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## Babel
- Install the scoped packages (`@babel/core`, `@babel/preset-env`, `@babel/preset-react`, `@babel/preset-typescript`), not the old unscoped `babel-core` / `babel-preset-*` names.
- If a preset that is installed reports `Could not find preset`, run `yarn list babel-core` to look for an old Babel 6 copy pulled in by another tool, and pin it with a `resolutions` entry.
- When Babel compiles TypeScript, run `tsc` only for type-checking, with `"noEmit": true`; add `"skipLibCheck": true` if it reports errors inside `node_modules`.
- Do not write TypeScript `namespace`s, `const enum`s, `export =` or `import =` in code compiled by the Babel TypeScript plugin.
- Never enable the TypeScript and Flow plugins in the same config; remove any preset that turns on Flow, or depend on its individual plugins.
- With `babel-node`, pass `--extensions '.ts,.tsx'` and start from a `.ts` entry file; add `.ts`/`.tsx` to `babel-plugin-module-resolver`'s `extensions` option too.
- Check what a transform produces in the Babel REPL before changing presets or targets.

Mistakes to avoid

babel.transform(code, options) used synchronously with @babel/core 8
babel.transformSync(code, options) or await babel.transformAsync(code, options)

In Babel 8 transform needs a callback; the synchronous fallback was removed.

"@babel/plugin-proposal-class-properties" (and other -proposal- plugins) in a Babel 8 config
Use the -transform- name, e.g. @babel/plugin-transform-class-properties, or drop it since preset-env includes it

These plugins were renamed when the features became standard; the old package is deprecated on npm.

Copying useBuiltIns: "usage" and corejs into @babel/preset-env options in Babel 8
Remove both and add babel-plugin-polyfill-corejs3 for polyfills

Babel 8 removed these options; some guide pages still show them in Babel 7 style.

Leaving out targets after upgrading and expecting the same output as Babel 7
Set a top-level "targets" (or a .browserslistrc file) to the browsers you really support

Babel 7 compiled for every browser by default; Babel 8 compiles for browserslist defaults, so old browsers can break.

Relying on the React preset's old "classic" default (React.createElement) after the upgrade
Set runtime explicitly: "automatic" for React 17+, or "classic" with useSpread: true if you keep it

The default JSX runtime changed from classic to automatic in Babel 8.

Questions

Does Babel check my TypeScript types?

No. It only removes them; run the TypeScript checker separately.

Which browsers does Babel 8 compile for by default?

The browserslist "defaults" list, which covers most modern browsers. Babel 7 compiled for all browsers by default.

Can I use Babel in the browser?

Yes, with @babel/standalone, mainly for playgrounds and prototypes; config files do not work there.

Can I write my own code changes with it?

Yes. Babel is built from plugins, and you can write your own to change code in any way.

Can I use it in a paid product?

Yes. Babel is MIT licensed; keep the notice with copies of its code.