ShadeKit.ioLoading…

HTML, CSS and JavaScript Minifier

Shrink HTML, CSS and JavaScript by removing comments and unnecessary whitespace. The minifier is deliberately conservative: it never renames variables or rewrites logic, and it keeps line breaks in JavaScript so automatic semicolon insertion behaves exactly as before.

The interactive tool loads here when JavaScript is enabled. Files are processed locally in your browser.

How to use HTML, CSS and JavaScript Minifier

  1. Choose HTML, CSS or JavaScript.
  2. Paste your code or upload a file.
  3. Review the minified output and the bytes saved.
  4. Copy the result or download the minified file.

Features

  • String, template and regular-expression literals are copied untouched.
  • Inline <script> and <style> blocks in HTML are minified with the matching engine.
  • Content of <pre> and <textarea> is preserved exactly.
  • Licence comments starting with /*! are kept in CSS and JavaScript.

Supported formats and limitations

Input: HTML, CSS or JavaScript text. Output: minified code to copy or download.

  • Variables are not renamed and code is not restructured, so output is larger than from a full build tool.

Frequently asked questions

Can minifying break my JavaScript?

This minifier only removes comments, indentation and blank lines and keeps every real line break, which avoids the usual automatic-semicolon pitfalls. Always test production builds anyway.

Why is the output not as small as a build tool's?

Build tools also rename variables and restructure code. This tool favours safety for quick, copy-paste minification.

Does the HTML minifier remove spaces between inline elements?

No. Spaces between inline tags such as links and bold text are meaningful, so they are kept as a single space.