JavaScript Formatter & Minifier
Beautify or minify JavaScript and TypeScript. Auto-processes as you type.
Related Tools
From the makers of JSON Knife
Get the JSON & API Cheat Sheet
Formatting tricks, jq commands, and common patterns — one page, zero fluff.
How to Format JavaScript Online
Messy JavaScript is hard to debug — whether it's a minified production bundle, auto-generated code, or a colleague's inconsistent style. This JavaScript beautifier reformats your code with proper indentation, line breaks, and consistent structure. Everything runs in your browser — your code never leaves your machine.
Paste in minified JS, a one-liner from your build output, or TypeScript that needs reformatting, and get clean, indented code you can actually read. The formatter handles functions, arrow functions, template literals, object destructuring, and all modern ES2024+ syntax. Switch to minify mode to strip comments and whitespace for production.
Unlike server-based formatters like Prettier (which requires Node.js), this tool runs entirely client-side with zero dependencies. It won't enforce opinionated rules — it just makes your code readable with configurable indentation (2 spaces, 4 spaces, or tabs). Perfect for quick formatting when you don't want to set up a full toolchain.
Tips
- Use the indent selector to match your project's style — 2 spaces is most common in JavaScript, tabs are popular in Go-influenced teams.
- Minify mode strips comments and collapses whitespace. The stats bar shows exactly how many bytes you saved.
- Template literals (backtick strings) are preserved as-is — the formatter won't break your embedded expressions.
- For a full formatting pipeline, use Prettier locally. This tool is for quick one-off formatting when you need to read unfamiliar code fast.