JavaScript Formatter

Beautify minified or inconsistently formatted JavaScript with Prettier - the same formatter most projects use - running locally in your browser.

How to use

  1. Paste your JavaScript code.
  2. Click Format.
  3. 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.

Related tools