HTML, CSS & JavaScript Minifier Pro
Removes what is provably not needed — comments and the whitespace between tokens — and measures the saving that matters by really compressing the result. Free preview · Pro required to export. Minify up to 3,000 characters of HTML, CSS or JavaScript free. Pro removes this limit and adds downloads.
Free preview · Pro required to export. Minify up to 3,000 characters of HTML, CSS or JavaScript free. Pro removes this limit and adds downloads.
Why use this tool?
- An inline script or style going into a template or a CMS has no build step to minify it.
- The raw saving is the number everyone quotes and the wrong one to judge by. Gzip was already collapsing most of that whitespace, so a 30% raw saving is often an 8% real one.
- Pasting source into an unknown server is a poor habit for anything from a private repository.
How to use HTML, CSS & JS Minifier
- Paste the code, or drop a .html, .css or .js file.
- The language is detected; override it if the guess is wrong.
- Read the gzipped figure, not just the raw one.
- Copy the result or download it.
Features
- HTML, CSS and JavaScript in one tool
- The real gzip size, measured with CompressionStream
- Strings, template literals, regular expressions and url() values are never looked inside
- Newlines that JavaScript's automatic semicolon insertion depends on are kept
- Licence comments (/*! … */) preserved by default
Tips
- If the gzip saving is near zero, the file was already fine and minifying it is not the optimisation you need.
- For an application bundle, minify in your bundler. It has a full parser and will do better than anything that has to stay conservative.
Frequently asked questions
Does this mangle variable names like terser?
No, deliberately. Renaming safely needs a full JavaScript parser and scope analysis; doing it approximately breaks code. This removes comments and whitespace only, so the result always behaves identically.
How much smaller will my file get?
Raw savings are typically 20–40% for JavaScript and CSS. After gzip — which is how files are actually served — the saving is usually much smaller, and the tool shows you both so you can see whether it is worth doing.
Is my code uploaded?
No. Everything, including the gzip measurement, happens in your browser.
Can I try this Pro tool without an account?
Yes. Minify up to 3,000 characters of HTML, CSS or JavaScript free. Pro removes this limit and adds downloads. Your own input is processed locally in your browser.
Will upgrading keep my work?
Checkout and login open in a separate tab. Keep the workspace open to retain inputs, settings and previews. Files stay in that tab only; keep the originals in case you close or reload it. Export access is checked with the server after payment.
Your files are processed directly in your browser and are not uploaded to HubToolify's servers.