JavaScript Formatter
Beautify minified or inconsistently formatted JavaScript with Prettier - the same formatter most projects use - running locally in your browser.
How to use
- Paste your JavaScript code.
- Click Format.
- Copy the cleaned-up result.
Examples
Minified to readable
Input: const a={b:1,c:[2,3]};
Output: const a = { b: 1, c: [2, 3] };
Frequently asked questions
Which style rules apply?
Prettier defaults: 2-space indent, double quotes, semicolons, trailing commas.