JavaScript Formatter & Beautifier
Paste JavaScript code (including minified files) and get a clean, indented version.
Features
How to Use
1. Paste JavaScript into the input box on the left.
2. Click Format to beautify, or Minify to compress.
3. Copy the formatted output.
About this tool
Minified scripts, code pasted from a chat or a bundle opened in the browser are hard to read on a single line. This formatter re-indents JavaScript based on braces, brackets and parentheses, puts statements on their own lines, and keeps strings and comments intact, so the structure of functions and objects becomes visible again. Choose two spaces, four spaces or tabs. Minify goes the other way, stripping comments and extra whitespace for a compact copy. It is a lightweight formatter that runs instantly in your browser rather than a full compiler, so it is ideal for reading and tidying code; for consistent formatting across a project, use Prettier or your editor's formatter.