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.

Everything runs in your browser — there's no upload, no queue, and no account. Paste, format, copy, and go.

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

Related tools

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.
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; a single unobtrusive ad slot covers hosting.

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.