Your code
Big file - press Minify (or Ctrl+Enter) to run it.
Shrink JavaScript and CSS files safely, or make minified code readable again. You see the real size before and after, including gzip, and your code never leaves the browser. Speeding up a whole site? Add a sitemap next.
Big file - press Minify (or Ctrl+Enter) to run it.
Keep your original, readable files for editing, and upload only the .min versions to your site.
We would rather be honest than squeeze out the last byte.
| Change | JavaScript | CSS |
|---|---|---|
| Remove comments | Yes (license kept) | Yes (license kept) |
| Remove spaces and indentation | Yes | Yes |
| Remove line breaks | Where safe - breaks that act as semicolons stay | Yes |
| Shorten values | No | #ffffff to #fff, 0.5 to .5 |
| Rename variables (mangling) | No | - |
| Rewrite or remove code | No | Only empty rules |
Because nothing is renamed, errors in the browser console still show your own function names - handy while debugging.
Smaller scripts and styles download and parse sooner, which helps Core Web Vitals and search rankings.
Servers compress text before sending it. We show the gzip size so you see the real saving on the wire.
Visitors on mobile data load your site with fewer bytes.
Images are usually the biggest files on a page. Compress them with the PNG compressor or turn them into WebP.
See everything in Webmaster Tools.
It removes what browsers do not need - comments, indentation, line breaks and extra spaces - so the file downloads faster. The code works exactly the same.
The tool shows the real size before and after, plus the gzip size your server actually sends.
No. Minifying and beautifying happen in your browser, so your code never leaves your device. The old version of this page sent code to our server - that is gone.
The JavaScript minifier reads your code token by token, so strings, template literals and regular expressions are never touched. Line breaks that JavaScript needs for automatic semicolons are kept.
After minifying, the browser parses the result as a syntax check. We also tested it on large libraries such as D3, KaTeX and pdf-lib, where the output parses to exactly the same program.
Those tools also rename variables (mangling) and rewrite code. This minifier only removes comments and whitespace, which is safer and easier to debug, but typically saves 30-50% instead of 50-70%.
For the smallest production bundles, use a build tool with Terser. For a quick, safe shrink of a script or stylesheet, this is ideal.
It removes comments and spaces, drops the last semicolon in each rule, shortens colours like #ffffff to #fff and 0.5 to .5, and removes empty rules. Spaces that matter, such as in calc() or between selectors, are kept. Custom properties (--variables) are left exactly as written.
Beautify does the opposite: it lays minified code out on separate lines with indentation, so you can read it. Pick 2 spaces, 4 spaces or tabs. It is a quick reformatter, not a full code-style tool like Prettier.
Yes. Drop up to 50 .js and .css files on the input box. Click any file to preview it, and download them all as a ZIP. Each file keeps its name with .min added.
Yes, by default. Comments that start with /*! or contain @license or @preserve stay at the top of the file, as most open-source licenses require. Switch off Keep license comments to remove them too.