.babelrc

What is a .babelrc file?

Babel transpiler config — which JavaScript syntax to compile, which presets to apply. Increasingly replaced by `babel.config.js`.

Safe format
Type Code
By Sebastian McKenzie (Babel)
MIME application/json

Drop any file to identify it

No upload. No signup. No sending your file halfway across the internet.
We tell you what it is, right here in your browser.

What is it

Babel transpiles modern JavaScript (ES2024+) to older versions (ES5) for browsers that don't support newer syntax. .babelrc is its config: which presets (`@babel/preset-env`, `@babel/preset-react`, `@babel/preset-typescript`) and plugins (`@babel/plugin-transform-runtime`) to apply, and which environments to target.

Babel 7 (2018) introduced a distinction between .babelrc (file-relative — only affects files in its directory tree) and babel.config.js (project-wide — affects everything in the project, including node_modules dependencies if needed). Modern Babel projects mostly use babel.config.js because monorepos and tools that need to transform third-party code work better with project-wide config. .babelrc remains common in older projects.

Babel's relevance is shrinking. Vite, esbuild, and SWC do equivalent transpilation and run 10-100x faster (esbuild and SWC are written in compiled languages — Go and Rust respectively). New projects increasingly skip Babel entirely. Where Babel still wins: complex plugin ecosystems (legacy decorators, experimental syntax), framework integrations (Next.js still uses SWC by default but supports Babel), and monorepo setups with custom transforms.

Technical details
Full Name
.babelrc
MIME Type
application/json
Developer
Sebastian McKenzie (Babel)
Magic Bytes
N/A
Safety
.babelrc is a known, safe format.
What opens it
Any text editor
FREE All
VS Code
FREE All
FAQ
What's the difference between .babelrc and babel.config.js?
Scope. .babelrc is file-relative — only affects files in its own directory tree, and Babel won't apply it to dependencies in node_modules. babel.config.js is project-wide — applies to everything Babel touches, including third-party code if you need it. For monorepos and projects that transform dependencies, use babel.config.js.
Do I still need Babel in 2026?
Less and less. Vite, esbuild, and SWC handle modern JavaScript transpilation faster and with simpler config. New projects often skip Babel entirely. Existing projects with established Babel setups (custom plugins, complex preset chains, framework integrations) usually have no urgent reason to migrate, but new code rarely starts with Babel.
Related formats