BackendBench
Coffee
Free tool

Code beautifier & minifier

Format messy or minified JavaScript, CSS, HTML and JSON, and minify CSS and JSON.

Result

Make minified or messy code readable

You copy a snippet from a bug report, a network tab or a minified bundle and it arrives as one unbroken line. Reading it, diffing it or even finding the closing brace is hopeless until it is formatted. Formatters also help when a project has no linter and the indentation has drifted over years.

Paste JavaScript, CSS, HTML or JSON, choose the indentation (2 spaces, 4 spaces or a tab) and get clean code. For JavaScript you can choose where braces go. CSS and JSON can also be minified, with a readout of how many bytes you save. The formatter library is loaded the first time you use the page; it runs entirely in your browser, so private code stays private.

What each mode does

The CSS minifier removes comments and unnecessary whitespace and shortens 0px and 0.5; it keeps string contents intact. It is deliberately conservative: for production builds use a dedicated tool such as lightningcss or cssnano, which can also merge rules and prefix properties.

Frequently asked questions

Which languages are supported?

JavaScript (including modern syntax such as arrow functions and classes), CSS, HTML and JSON can be formatted. CSS and JSON can also be minified.

Why is there no JavaScript minifier?

Safe JavaScript minification needs a full parser that renames variables and removes dead code, which is a heavy library. Use your build tool (esbuild, Terser, Vite) for that. Whitespace-only "minifying" of JS is unsafe because of automatic semicolon insertion.

Will formatting change what my code does?

No. Beautifying only changes whitespace and line breaks. The one exception to watch for is whitespace-sensitive content, such as text inside

 or template literals, which is left untouched.

Which indent should I use?

Match your project: two spaces is common for web code, four for many Java-adjacent projects, and tabs let each developer choose the visual width. Consistency matters more than the choice.

More tools you might need