JavaScript Formatter & Beautifier
Beautify minified or messy JavaScript with clean, consistent indentation.
About this tool
Paste minified, compressed, or inconsistently indented JavaScript to reformat it with clean, readable 2-space indentation, consistent spacing, and line breaks — the opposite of the JS Minifier. Uses Terser's beautify output mode, running entirely in your browser.
Nothing is uploaded — your source code is reformatted locally and never leaves your device.
Example
const sum=(a,b)=>{return a+b};let t=0;for(let i=0;i<10;i++){t+=sum(i,1)}console.log(t) const sum = (a, b) => {
return a + b;
};
let t = 0;
for (let i = 0; i < 10; i++) {
t += sum(i, 1);
}
console.log(t); Frequently asked questions
- Does this change what my code does?
- No — only whitespace, indentation, and (optionally) semicolon insertion change. No variables are renamed and no logic is altered, since compression and mangling are both turned off.
- Can this un-minify variable names back to what they originally were?
- No — once code is minified, the original variable names are gone for good (unless a source map was kept). This tool restores readable structure and indentation, not the original naming.
- What happens with invalid JavaScript?
- Formatting fails and a hint explains that the source has a syntax error — check for a missing bracket, quote, or semicolon near where the error points.