Turn minified or messy JavaScript into clean, consistently formatted code.
Loading tool…
The formatter runs Prettier, the code formatter used by most JavaScript projects, in your browser. It parses your code and prints it again with consistent indentation, line breaks, spacing and quotes, so even a one-line minified file becomes readable. It supports modern JavaScript and JSX; if the code has a syntax error you'll see where it is.
Make a minified script readable to debug or learn from it.
Format snippets the same way as a Prettier-based project.
Clean up code before pasting it into docs, tickets or answers.
No. Prettier only changes layout: indentation, line breaks, spacing, quotes and optional parentheses. The program behaves exactly the same.
Yes: classes, async/await, optional chaining, modules and JSX. TypeScript isn't supported on this page.
It restores readable layout, but minified variable names like a and b stay short, because the original names are gone.
Prettier needs valid code to format it, so you'll see the error and its line instead. The JavaScript Validator can help you track it down.
No. Everything runs in your browser; nothing you paste or upload is sent to our servers.