Converters & Dev

Code Minifier

Paste CSS, HTML, JavaScript or JSON and strip out everything a browser does not need — or go the other way and tidy a minified file back into something readable.

Your code

Result

Before
—
After
—
Saved
—

What minifying does

Source code is written for people: indentation, comments, long names. None of it means anything to a browser. Minifying strips the whitespace and comments — and for JavaScript, shortens local variable names — so the file downloads faster. The behaviour stays exactly the same.

What each language gets

How to use it

  1. Pick the language and whether you want it minified or tidied.
  2. Paste the code. The before-and-after sizes appear with the result.
  3. Copy or download. For JavaScript, the Terser library is fetched the first time you use it.

When it is worth it

A caution on HTML

Whitespace between inline elements is meaningful — removing it can push two words together. The minifier here collapses space between tags, which is safe for block layout and can occasionally change spacing around <span> and <a>. Check the result before shipping a page.

Frequently asked questions

Does minifying change what my code does?

It should not. Whitespace, comments and local variable names carry no meaning. The one thing to check is HTML, where space between inline elements is visible on the page.

Can I get my original code back?

Not exactly. Tidying restores the formatting, but comments and the original variable names are gone for good. Always keep the unminified source.

Is my code uploaded anywhere?

No. CSS, HTML and JSON are handled by the page itself, and JavaScript is processed by a library downloaded into your browser. The code never leaves your machine.