HTML, CSS & JavaScript Minifier Pro
Removes what is provably not needed — the whitespace between tokens, and comments you choose to drop — 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.
What is HTML, CSS & JS Minifier?
HubToolify's HTML, CSS & JS Minifier makes HTML, CSS or JavaScript smaller by removing the whitespace between tokens and comments, and nothing else: it does not rename variables, drop code or reorder anything, so the result behaves like the source. It is meant for developers putting an inline script or style into a template with no build step. The language is detected or set by hand, and code can be pasted or dropped as an .html, .css or .js file. Strings, template literals, regular expressions and url() values are left alone, newlines that JavaScript's automatic semicolon insertion relies on are kept, /*! licence comments in CSS and JavaScript stay by default, and HTML conditional comments are always kept. It also measures the real gzip size by compressing both versions with the browser's CompressionStream. Everything, gzip test included, runs locally in the browser. It is a Pro tool: a free preview minifies and copies up to 3,000 characters, and Pro removes the 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. A guest can open the preview 5 times; after that a free account keeps it. Your input is processed in your browser and is not uploaded.
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.