In short
To beautify JavaScript, paste the code, choose an indent size and copy the formatted result. Minified code is expanded with line breaks and consistent indentation, handy for reading third-party scripts or debugging. Variable names shortened by a minifier can't be restored.
How to use the JavaScript Beautifier
- 1Paste or type your input in the left box (or click "Try an example").
- 2Adjust the options if needed. The result updates as you type.
- 3Copy the result or download it as a file.
Formatter vs linter
A beautifier only changes whitespace. For enforcing a code style in a project, use Prettier or ESLint in your editor.
Frequently asked questions
Does it support JSON?
Yes, but the JSON Formatter also validates it.
Will it change my code's behaviour?
No, only whitespace and line breaks are changed.
Is my data sent anywhere?
No. Everything runs in your browser. What you paste is never uploaded, logged or stored, so it's safe for code, tokens and private content.
Last updated

