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
- Unminify and pretty print JS
- Modern ES syntax and JSX
- JavaScript minifier (Terser)
- Syntax errors reported with the line number
- TypeScript formatter on its own page
How to use
- Paste JavaScript or open a .js file.
- Press Beautify.
- Press Minify to compress.
- 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
- BeautifyAll-in-one beautifier
- JSON Beautifier & FormatterFormat & validate JSON
- XML Beautifier & FormatterPretty print XML
- HTML Beautifier & FormatterClean up HTML markup
- CSS Beautifier & FormatterFormat CSS, SCSS & LESS
- TypeScript Formatter & BeautifierFormat TS code
- SQL Formatter & BeautifierFormat SQL queries
- YAML Formatter & ValidatorFix YAML indentation
- Markdown FormatterTidy Markdown docs
- GraphQL FormatterFormat GraphQL queries
- Text BeautifierClean up plain text