JavaScript Beautifier & Formatter Online

Make minified or messy JavaScript readable again with Prettier-quality formatting.

Input —
Drop file to load
0 lines · 0 chars
Output —
0 lines · 0 chars
Ready. Paste something and press Beautify.

About this JavaScript Beautifier & Formatter

Paste compressed or badly formatted code into this JavaScript beautifier to get consistent indentation, spacing and line breaks. It uses Prettier and understands modern syntax: arrow functions, async/await, classes, optional chaining and JSX.

You can also minify JavaScript to strip comments and whitespace.

Features

How to use

  1. Paste JavaScript or open a .js file.
  2. Press Beautify.
  3. Press Minify to compress.
  4. Copy the code.

Frequently asked questions

How do I unminify JavaScript?

Paste the minified JS above and press Beautify. Note that variable names shortened by a minifier can't be restored, but the structure becomes readable.

Does the JS beautifier change how my code runs?

No. Formatting only changes whitespace, semicolons and quote style. The program behaves the same.

Does it support JSX?

Yes. React JSX is supported in JavaScript mode.

More free formatters