Skip to content
M2TOOLKIT

Developer · free tool

JavaScript Formatter

Turn minified or messy JavaScript into readable, indented code.

Use it as often as you like — it's free, with no sign-up and no limits.

  • Developer
  • Free
  • No sign-up
  • Runs in your browser
  • Updated

Your code is formatted in the browser and never executed.

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us.

How to use the JavaScript Formatter

  1. Paste your JavaScript into the left box, or open a file.
  2. Adjust the options if you need to.
  3. Copy the formatted JavaScript or download it as a file.

What does this tool do?

The formatter re-prints your code with consistent indentation and line breaks. It doesn't rename variables, so minified names stay short — but the structure becomes easy to follow.

Why use it?

  • Debug minified scripts.
  • Review code snippets from tickets and chats.
  • Never executes your code.

Example

function f(a){return a*2} becomes
function f(a) {
  return a * 2
}

Privacy

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.

Frequently asked questions

Will formatting change how my code runs?

No. Only whitespace and line breaks change. The code is re-printed, never executed.

Can it restore the original variable names of minified code?

No. Minifiers throw the original names away, so there's nothing to restore. If the site publishes source maps, browser developer tools can use those to show the original code.

Last reviewed by the M2Toolkit team.

Other tools people use alongside the javascript formatter.