Follow Us

JavaScript Beautifier

Turn minified or messy JavaScript into clean, readable code. Pick your indent and brace style — works for JS, JSON and most TypeScript.

Beautified JavaScript

Runs in your browser — your code is never uploaded. Tip: drop a file on the input box, or press Ctrl + Enter.

How to Beautify JavaScript

Make any JavaScript readable in three steps.

1

Paste or Upload JS

Paste minified or messy code, or upload a .js file.

2

Choose a Style

Pick 2, 4 or 8 spaces or tabs, and where braces go.

3

Copy or Download

Copy the clean code or download it as a .js file.

Indent

2, 4, 8 or tabs

Works with

JS, JSON, JSX

Speed

Instant

Privacy

Runs in your browser

Works on

Phone & computer

Price

100% free

Brace Styles

Choose the style your team uses.

StyleLooks like
Same line (collapse)if (a) {
  b();
} else {
New line (expand)if (a)
{
  b();
}
else
End expandif (a) {
  b();
}
else {

What Can You Use It For?

Popular ways people use JavaScript Beautifier.

Read Minified Code

Unminify .min.js files to see how a script works.

Debugging

Format code from the browser console or error logs.

Consistent Style

Make code from different people look the same.

Learning

Study how libraries and websites are built.

Tips for the Best Result

  • Beautifying adds spaces back, but variable names shortened by a minifier (like e, t) cannot be restored.
  • For packed or encoded code, use the JavaScript Deobfuscator first.
  • Ready to publish? Shrink it again with the JS Minifier.
  • Press Ctrl + Enter to run again after editing.

Frequently Asked Questions

Quick answers about JavaScript Beautifier.

It adds line breaks and indentation to JavaScript so it is easy to read. It does not change how the code works.

Yes. Paste or upload it and the code is formatted. Short variable names stay short, because the original names are not in the file.

Yes. For JSON with error checking, use our JSON Validator & Formatter.

ES6+ and JSX are supported. Most TypeScript formats well too, though some type syntax may look unusual.

2 or 4 spaces are the most common. Use the same setting as your project or editor.

Beautify only fixes formatting. Deobfuscate also unpacks packed code and decodes escaped strings.

No. Everything runs in your web browser, so your code and data never leave your device.

Yes — 100% free, with no sign-up and no limits.

Related Free Tools

Ready to Use JavaScript Beautifier?

Scroll up and get your result in seconds. 100% free, no sign-up needed.

Start Now

Ad Blocker Detected

Toolszu provides free access to over 1,000 tools. We rely on minimal ads to maintain our servers and keep improving the site for everyone.

Please pause or disable your ad blocker to continue using Toolszu.

or
Go ad-free — from $19/year

Already have a plan? Sign in