HTML, CSS & JavaScript Formatter and Minifier

Beautify or minify HTML, CSS and JavaScript (plus SCSS, Less and TypeScript formatting) with size and gzip savings shown.

Runs in your browser — your data never leaves your device

Frequently Asked Questions

What is the difference between formatting and minifying?

Formatting (beautifying) adds consistent indentation, line breaks and spacing so code is easy to read. Minifying does the opposite: it removes everything a browser does not need, such as whitespace, comments and long variable names, so the file downloads faster. The code behaves the same either way.

Which formatter does this use?

Prettier, the same formatter most JavaScript projects run in their editor and CI. You can set the indent (2 spaces, 4 spaces or tabs), line width, quote style and semicolons, and it formats HTML, CSS, SCSS, Less, JavaScript (including JSX) and TypeScript.

Can I unminify or beautify a minified JavaScript file?

Yes. Paste the minified code in Format mode and it is re-indented and split into readable lines. Variable names that were shortened during minification cannot be restored, since the original names are no longer in the file.

How much smaller does minified code get?

It depends on how the source is written, but 20–60% before compression is typical: JavaScript gains the most from shortened names and dead code removal, CSS from merged rules and shorter values. The tool shows both the raw and the gzipped size of the input and output, since servers usually send files compressed.

Is minified JavaScript safe to use in production?

Yes. Terser only applies transformations that keep behavior the same, and comments starting with /*! or containing @license or @preserve are kept so license notices survive. Turn off "Shorten variable names" if other scripts rely on your global function names, and only enable "Remove console.*" when you no longer need the logs.

Why can't I minify TypeScript, SCSS or Less?

Browsers cannot run those languages directly, so they have to be compiled to JavaScript or CSS first, usually by your build tool, which minifies at the same time. You can still format them here.

Is my code uploaded anywhere?

No. Formatting and minifying both run in your browser. The formatting and minifying libraries are downloaded the first time you use them, and your code is never sent to a server.