How to use the JavaScript Formatter
- Paste your JavaScript into the left box, or open a file.
- Adjust the options if you need to.
- 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.
Last reviewed by the M2Toolkit team.