About JavaScript Formatter
Paste JavaScript that is cramped, inconsistently indented or squeezed onto one line, and get it back in a consistent, readable style. Formatting is done by Prettier, the formatter many projects already use, with a line width of 100 characters.
Modern syntax such as arrow functions, async/await, classes, modules and JSX is supported. If the code has a syntax error, the message and its position appear in the Problems panel.
How to use it
- Paste your code into the Input panel, or Open a .js, .mjs, .cjs or .jsx file.
- Choose an indent of 2, 4 or Tab.
- Fix any syntax error listed in Problems. Click it to jump to the line.
- Copy the result or Download it as a .js file.
Frequently asked questions
Can it deobfuscate minified JavaScript?
It restores line breaks and indentation, which makes minified code much easier to read. Short variable names chosen by the minifier stay as they are.
Which style does it use?
Prettier’s defaults with a 100-character line width and your chosen indent.
Is my code sent anywhere?
No. Prettier runs in your browser, so the code stays on your device.