JS Formatter
Pretty‑print JavaScript with basic rules
Start
Description
JS Formatter improves the readability of compact JavaScript by adding indentation and line breaks.
Key features
- Indent blocks around { and add line breaks after
; - Two‑panel UI with Copy, Clear, and Sample
- Runs fully in your browser
How to Use
- Paste minified JS on the left.
- Formatted JavaScript appears on the right.
- Copy and continue debugging or reviewing.
Example
Example
Input:
function x(a){if(a){return 1;}else{return 2;}}Output:
function x(a) {
if (a) {
return 1;
} else {
return 2;
}
}FAQ
Does this parse JS fully?
It’s a basic formatter, not a full AST‑based pretty‑printer.
What about TypeScript?
It targets generic JavaScript; TypeScript may not format perfectly.