JavaScript Formatter
A JavaScript Formatter reprints minified or inconsistent JavaScript into readable, canonically formatted code using Prettier's engine in your browser — with JSX, TypeScript, and TSX supported by the same tool.
(formatted output appears here)About JavaScript Formatter
Paste minified JavaScript and get back properly indented code with consistent quotes, semicolons, and line breaks. Unlike simple beautifiers that only re-indent text, Prettier parses the code and reprints it from the syntax tree, so the result is canonical rather than a best guess — and because the parser has to succeed first, a syntax error is reported with an exact line and column instead of being silently passed through. TypeScript and TSX use the TypeScript parser, so types, generics, and decorators survive intact. The engine is bundled with the page, so nothing you paste is uploaded.
What JavaScript Formatter does
- JavaScript, JSX, TypeScript, and TSX in one tool
- Reprints from the syntax tree — canonical, not re-indented text
- Semicolons, quote style, trailing commas, arrow parens
- Exact line and column on a syntax error
- Runs the real Prettier engine, self-hosted — no CDN
- Copy or download the formatted source
When to reach for JavaScript Formatter
- Reading a minified bundle you're debugging
- Cleaning up a snippet copied from a gist or answer
- Normalising code style before a review
- Formatting TypeScript on a machine without an editor set up
How to use JavaScript Formatter
- 01
Paste your code
Paste JavaScript, JSX, TypeScript, or TSX into the input pane.
- 02
Set your style
Choose indentation, quotes, semicolons, and wrap column.
- 03
Copy or download
Copy the formatted code or download it as a file.
When to use JavaScript Formatter vs alternatives
| Alternative | Use JavaScript Formatter when… | Use the alternative when… |
|---|---|---|
| A basic JS beautifier | you want Prettier's canonical output plus real TypeScript and JSX support. | you need to beautify code that doesn't parse — a lenient beautifier will still indent it. |
| Running Prettier in your editor | the snippet isn't in a project, or you can't install anything on this machine. | you're formatting files in a repo you already have open. |