Skip to content
OneTooling

Minifier

Minify JavaScript, CSS, and HTML in your browser. See the size before and after, with a gzip estimate. Your code is never uploaded.

Runs in your browser · nothing uploaded
Language
Before
317 B
After
–
Saved
–
Gzip (before → after)
–

Why is there an ad? This tool is free and runs on your device. One small ad pays for hosting and new tools. No pop-ups, no autoplay, never inside the tool. How we make money

How to minify code

  1. Pick JavaScript, CSS, or HTML, then paste your code or open a file.
  2. Adjust the options if you need to. The result updates as you type.
  3. Check the size before and after, including the gzip estimate, then copy or download the result.

Minifying removes comments, whitespace, and unused code to make files smaller, which makes pages load faster. Keep your original source: minified code is hard to read and edit.

Questions

Is my code uploaded?

No. The minifiers run in a background thread inside your browser, so your source code stays on your device.

Which languages can it minify?

JavaScript (including ES modules), CSS, and HTML. Inline scripts and styles inside an HTML file are minified too. It works as a JS minifier, a CSS minifier, and an HTML minifier.

Will minifying break my code?

The JavaScript and CSS minifiers are widely used and keep behavior the same. If you rely on function names (for example in error messages or reflection), turn off "Shorten names". The HTML minifier is deliberately cautious: it removes comments and extra whitespace but leaves tags, attributes, and the contents of pre and textarea alone.

What does the gzip size mean?

Web servers usually compress files with gzip before sending them. The gzip figure is what your file would roughly weigh on the wire, so it is the number that matters for page speed.

Can I keep license comments?

Yes. For JavaScript, comments that start with /*! or contain @license or @preserve are kept by default.

Credits

Built on Terser (BSD-2-Clause) and CSSO (MIT). OneTooling is not affiliated with these projects.