EN
PortuguêsEnglishEspañol
All tools
Developer tools 100% free

JavaScript formatter (indent and beautify)

Format minified or messy JavaScript online: 2 or 4 space or tab indentation, braces on the same line or the next, and wrapping of long lines, to read and debug any site's scripts.

How to use

Thank you so much for helping!

Every donation helps pay for the servers and keeps the tools free for everyone. Pick or type an amount:

Secure payment by Stripe. Opens in a new tab.

Back to Format and convert

Paste your JavaScript.

Available in: PortuguêsEnglish

Advertisement

JavaScript formatter (indent and beautify): what it is for

Minified scripts arrive on a single line, impossible to read or debug. Paste the code and it gets one statement per line again, with 2 or 4 space or tab indentation, braces on the same line or the next and wrapping at 100 columns.

The structure is recovered, but variable names shortened by minification do not come back, because they are no longer in the file. JSON is formatted too. The code is not executed: the tool only rearranges the text, in your browser, with the js-beautify library.

How to use

  1. Paste the JavaScript.
  2. Choose the indentation and brace style.
  3. Copy or download the result.

When to use it

  • Reading a third-party script.
  • Debugging minified code.
  • Tidying copied snippets.

Frequently asked questions

Does formatting recover the original code of a .min.js?

It recovers the structure: indentation, line breaks and one statement per line. Variable names shortened by minification (a, b, c) do not come back, because the original names are no longer in the file.

Does it work with JSON and TypeScript?

JSON is formatted normally. In TypeScript, most code comes out right, but complex types and decorators may get odd spacing; check before using it.

Is the code executed?

No. The tool only rearranges the text; the script does not run in your browser.

Is it really free?

Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 tools are free and run right in your browser.

Similar tools

The tools are provided as is, without warranty. We are not responsible for the results or for how they are used.