Web File Minifier
Minify HTML, CSS, and JavaScript with reviewed libraries and show the savings, without executing the code.
Removes comments and spare spaces. Text in quotes, regular expressions, and <pre> stay as written, and a line break that ends a statement without ; is kept. Names are not shortened, so a build tool can still save more. /*! comments */ are kept.
Your result
Paste code and the smaller version appears here.
How to use it
- Choose the language.
- Paste the code or press Try a sample.
- Copy the result or download it.
Examples
- CSSa { color: red; } a{color:red} (19 → 12 bytes)
- A JavaScript commentconst url = 'https://x.com'; // c const url='https://x.com';
- HTML<p>Hello <b>world</b></p> <p>Hello <b>world</b></p>
Tool details and privacy
Paste code and get a smaller copy ready to use, with the size in bytes before and after and how much you saved.
Smaller files load faster, especially on mobile connections.
Options
- Comments are removed; /*! */ comments, which usually hold the licence, are kept.
- In HTML, <style> and <script> are minified too, and <pre> stays as is.
- In JavaScript, a line break that ends a statement without a semicolon is kept so the meaning does not change.
Limits
- Names are not shortened, so build tools such as Vite or esbuild save more.
- Quoted text, regular expressions, and `…` templates stay intact, and the code is not run.
Privacy
What you type stays in your browser. Nothing is uploaded or saved on the server.
Questions
Why are some line breaks left in JavaScript?
Removing them could change the code's meaning where there is no semicolon.
Can minifying break links inside text?
No. // inside quotes is not treated as a comment.
Is the code run?
No.
Is anything uploaded?
No.