Babel is a JavaScript transpiler.

Use next generation JavaScript, today.

ES6 and beyond

Babel will turn your ES6+ code into ES5 friendly code, so you can start using it right now without waiting for browser support. Learn more →

  • Abstract references
  • Array comprehension
  • Arrow functions
  • Async functions
  • Async generator functions
  • Classes
  • Computed property names
  • Constants
  • Default parameters
  • Destructuring
  • Exponentiation operator
  • For-of
  • Generators
  • Generator comprehensions
  • Let scoping
  • Modules
  • Object rest/spread
  • Property method assignment
  • Property name shorthand
  • Rest parameters
  • React
  • Spread
  • Tail call optimisation
  • Template literals
  • Types
  • Unicode regex

export default React.createClass({
  getInitialState() {
    return { num: this.getRandomNumber(); };
  },

  getRandomNumber(): number {
    return Math.ceil(Math.random() * 6);
  },

  render(): any {
    return <div>
      Your dice roll:
      {this.state.number}
    </div>;
  }
});

JSX and React

Babel works perfectly with React, featuring a built-in JSX transformer. Use it together with the babel-sublime package to bring syntax highlighting to a whole new level.


Extensible

With a large range of plugins and browser support.

Plugins and Browsers

It's time to make the switch.

Babel is available wherever you use JavaScript - so start using it today!

Browsers

Browsers

Babel has plugins for all of your favorite build systems. Check out the official plugins for Gulp, Grunt, Browserify, Webpack, Broccoli, and many more. You can also use the built-in CLI.


Node.js

Node.js

Using either the CLI or require hook, you can easily setup babel to work with your Node.js app. Module authors can also easily precompile their assets before publishing to npm.


Rails

Rails

Sprockets 4 will ship with babel by default using the `.es6` file extension. Until then you can use the Sprockets ES6 transform or the official babel Ruby Gem.


Browserify

Browserify

Babel and Browserify get along wonderfully with the official babelify transform babel transforms the module syntax to browserify-compatible Common.js modules by default.