1. Home
  2. Coding Tools
  3. JavaScript Formatter

JavaScript Formatter

Beautify minified or messy JavaScript into clean, readable code with consistent indentation and brace style.

Runs locally in your browser. Your files and data are never uploaded or stored.

About the JavaScript Formatter

The JavaScript Formatter transforms compressed, minified or poorly indented JavaScript into clean, readable code. It is ideal for studying third-party scripts, debugging production bundles, reviewing code snippets from forums, and tidying up your own code.

The formatter supports modern JavaScript syntax including arrow functions, classes, template literals, async/await and modules, and it also works for JSON. Choose your preferred indentation. Note that formatting cannot restore original variable names that were shortened by a minifier, but it makes the logic far easier to follow.

How to use the JavaScript Formatter

  1. Paste your JavaScript into the input box.
  2. Choose 2 spaces, 4 spaces or tabs.
  3. Click Format JavaScript.
  4. Copy the beautified code.

Frequently asked questions

Can it recover original variable names?

No. Minifiers permanently rename variables, but formatting still restores readable structure and indentation.

Does it execute my code?

No. The code is only parsed as text for formatting and is never executed.

Does it support TypeScript?

Simple TypeScript usually formats correctly, but type-heavy syntax may not be handled perfectly.