Home All 32 Tools

Categories

Text ToolsImage ToolsDeveloper ToolsDesign & CSS GeneratorsBlogger, SEO & YouTube ToolsCalculators & Utilities

Site

About Us Contact Us Privacy Policy Disclaimer
Developer Tools

HTML, CSS & JS Minifier

Strip comments and unnecessary whitespace from HTML, CSS or JavaScript, and see exactly how many bytes and what percentage you saved.

Free forever Nothing uploaded Works offline No sign-up
0 BOriginal
0 BMinified
0 BSaved
0%Reduction

About the HTML, CSS & JS Minifier

Minification removes the characters a browser does not need. Comments explaining why a workaround exists, the indentation that makes a nested rule readable, the blank lines separating sections — all of it helps humans and none of it affects execution. Removing it typically cuts CSS by 20–30% and JavaScript by 30–50% before any compression is applied on top.

The saving matters most on the critical rendering path. CSS in the head blocks rendering until it has downloaded and parsed, and synchronous JavaScript blocks it too. Shaving 30% off a stylesheet that every visitor waits for is a direct improvement to First Contentful Paint, and it compounds with gzip or Brotli rather than being made redundant by it — a minified file compresses to a smaller size than an unminified one.

This minifier is deliberately conservative. Aggressive tools rename variables, reorder statements and rewrite expressions, and while that squeezes out more bytes it also occasionally changes behaviour. Here, comments and redundant whitespace are removed while string contents, regular expressions, template literals and the semantics of your code are left completely alone. What comes out behaves exactly like what went in.

How to use it

  1. Pick a languageHTML, CSS or JavaScript — each uses rules appropriate to its syntax.
  2. Paste your codeDrop in a stylesheet, a script or a full HTML document. There is no size limit.
  3. Set the optionsChoose whether to keep important comments, such as licence banners that must remain in the output.
  4. MinifyThe compressed version appears immediately alongside the original and compressed byte counts.
  5. Check the savingOriginal size, minified size, bytes saved and the percentage reduction are all displayed.
  6. Copy or downloadTake the result to your clipboard or save it as a .min file ready to deploy.

Features

  • Three languagesSeparate, syntax-aware handling for HTML, CSS and JavaScript.
  • String and regex safeContent inside quotes, template literals and regular expressions is never touched.
  • Licence comment preservationOptionally keep /*! banner comments that a licence requires you to ship.
  • Detailed statisticsBytes before and after, absolute saving and percentage reduction.
  • Conservative by designNo renaming, no reordering, no expression rewriting — behaviour is preserved.
  • Runs locallyProprietary source code is never uploaded, so commercial work can be minified safely.

Who uses this tool

  • Front-end developersMinify a stylesheet or script for a project that has no build pipeline set up.
  • WordPress and theme usersCompress custom CSS before pasting it into a theme's additional-CSS panel.
  • Email developersSqueeze inline HTML email templates under the size limits mail clients impose before clipping.
  • Students and hobbyistsSee concretely how much of a source file is formatting rather than instructions.

Tips worth knowing

  • Always keep the readable source. Minified code is for deployment only; debugging a minified file without a source map is painful.
  • Minify before enabling gzip or Brotli, not instead of it — the two techniques stack and the combined result is smaller than either alone.
  • In HTML, whitespace between inline elements is significant. This tool preserves single spaces there rather than collapsing them and shifting your layout.

Frequently asked questions

Will minifying break my code?

It should not. The minifier only removes comments and redundant whitespace, and it never touches the inside of strings, template literals or regular expressions. It does not rename variables or reorder statements, which is where aggressive minifiers occasionally introduce bugs. Test before deploying anything, as you would with any build step.

How much smaller will my file get?

Typically 20–30% for CSS and 30–50% for JavaScript, depending on how heavily commented and indented the source is. The tool reports the exact figures for your file rather than an estimate.

Should I minify if my server already uses gzip?

Yes. Minification and compression work on different redundancies and stack well: a minified file gzips to a smaller size than an unminified one. The combination is meaningfully better than either alone.

Does it remove all comments?

By default yes, with an option to preserve important comments — the /*! style used for licence banners that legally must remain in distributed code.

Can I un-minify code?

Not perfectly. Whitespace can be restored by a beautifier, but comments are gone for good because they were deleted. That is why you keep the original source in version control.

Is my source code uploaded?

No. Minification runs in your browser. Commercial or unreleased code can be minified here without any of it being transmitted.

All Developer Tools