Reformat JavaScript with Prettier, in the indent style you use
Runs in your browser. Nothing you type is sent anywhere. Updated on 24 Oct 2026.Code arrives in someone else's house style: four spaces here, no semicolons there, lines that run to 200 characters. Paste it and Prettier rewrites the layout to the settings you pick, leaving the behaviour untouched. It is the fastest way to make a snippet from a forum answer or an old file match the project you are pasting it into.
The page opens in Beautify mode; paste the code into JavaScript or JSX.
Choose 2 spaces, 4 spaces or Tab under Indent, and set Wrap at for long lines.
Turn Semicolons and Single quotes on or off to match your project.
Read the Beautified pane, then press Copy and paste the code into your project.
This JavaScript formatter does the two things people want from a script file. Beautify runs Prettier over it and returns the same code laid out your way: two spaces, four spaces or a tab, semicolons or not, single or double quotes, and a line width you choose. Minify runs terser and returns the smallest equivalent file, with the size before, the size after and the percentage saved.
It suits the small jobs that interrupt a day. A snippet copied from an answer online uses a style your project does not. A file you inherited has three statements per line. You need to see roughly how big a helper will be once it ships, before deciding to write it yourself. And sometimes you need the opposite: a minified bundle expanded enough to work out what a third-party script is doing.
The tool reads plain JavaScript and JSX. TypeScript is not supported: if you paste it, the parse error would be useless, so the page checks first and tells you which TypeScript construct it found, such as a type alias or a typed parameter. Everything runs in your browser, so unreleased code and anything with a key in it never leaves your device.
The rest of the article, and all 6 questions about JavaScript Beautifier & Minifier, are on the JavaScript Beautifier & Minifier page.
Yes. No signup, no size limit and no cap on how many files you run through it. The page is paid for by a few ads shown outside the tool, and nothing is inserted into your code.
No. Both Prettier and terser run in your browser. Unreleased code, internal endpoints or an API key sitting in a config object never leave your device, and nothing is stored once you close the tab.
No. It reads plain JavaScript and JSX. If you paste TypeScript, the page tells you which construct it found, such as a type alias or a typed parameter, instead of showing a parse error that explains nothing. Strip the types first, or use a TypeScript-aware editor.
You can get the layout back, not the names. Beautify adds line breaks, indentation and spacing so the code is readable, but a minifier discards the original variable names and comments, and no tool can recover them.
Still stuck? Ask about JavaScript Beautifier & Minifier and anybody who knows can answer. No account needed.
On the related tools: GraphQL Validator – Check a GraphQL query or schema for errors, optionally against your own SDL · Markdown to HTML – Convert Markdown into clean, safe HTML you can paste anywhere.
In the collection Code Formatters and Minifiers.