To minify code, choose the language, paste your code and select Minify; the size saving is shown. To make minified code readable again, select Beautify. For JavaScript, tick “compress & shorten names” for the smallest output.
How to use the HTML / CSS / JS Minifier & Beautifier
-
1
Pick HTML, CSS or JavaScript
-
2
Paste code or open a file
-
3
Minify or beautify
Then copy or download.
How it works
JavaScript is parsed by Terser, a real JavaScript minifier, so syntax errors are reported with the line number and the output is always valid code. CSS minification removes comments and whitespace and shortens zero values; HTML minification collapses whitespace and removes comments while leaving <pre>, <textarea>, <script> and <style> contents untouched. Licence comments (/*! … */) are kept.
Features
-
Safe JS minification
Real parser, not regex.
-
Readable beautify
Choose 2, 4 spaces or tabs.
-
Licence comments kept
/*! and @license comments survive.
Privacy and file handling
- Where it runs
- Runs in your browser
Runs entirely in your browser. Your files and text are not uploaded to our servers.
Limitations
- HTML minification is conservative (whitespace and comments only).
- Name mangling can break code that relies on function names (e.g. reflection).
Frequently asked questions
Is my code uploaded?
No. Minifying and beautifying happen in your browser.
Was this tool helpful?
Thanks for the feedback.
Last reviewed