Options

Beautify and format JavaScript

Paste messy or minified JavaScript and get it back cleanly formatted with consistent indentation, spacing, and line breaks. It's powered by Prettier's standalone build, so the result matches the formatting millions of developers already use. Big files are formatted in the background, errors show the line in a syntax-coloured editor, and you can open or drop files.

Everything runs in your browser — there's no upload, no queue, and no account. Paste, format, copy, download, or send it to Code Compare to see the changes.

Need another language or mode? See all formatters and minifiers.

JavaScript Beautifier — frequently asked questions

How do I beautify JavaScript?
Paste your JavaScript into the left panel and the formatted result appears on the right instantly. Copy it or download it as a file.
What does the JavaScript beautifier do?
It re-indents and reformats your JavaScript with consistent spacing and line breaks, using the same battle-tested engine (Prettier) many teams run in their editors — so the output matches a widely accepted style. Indent, line width, quotes, semicolons and trailing commas are yours to set, and the choices are remembered. JSX is read too.
Is my code uploaded anywhere?
No. Formatting and minifying run entirely in your browser with JavaScript — your code never leaves your device. It's free with no sign-up.

Spotted a bug or have a suggestion?

Found something broken, have an idea, or just want to say thanks about any of our tools? Every message reaches a real person.