FREE WEB TOOL

Minify CSS, JavaScript, or HTML

Create a smaller copy of CSS, JavaScript, or HTML.

Enter code

This is conservative whitespace/comment removal. Test production code after conversion.

How to use it

Quickly remove common comments and unnecessary whitespace from CSS, JavaScript or HTML. This is a lightweight minifier, so keep the original source and test the result before using it in production.

  1. Choose CSS, JavaScript or HTML.
  2. Paste code and select Minify.
  3. Review the reduction and test the transformed copy before production use.
HTML
Removes comments and compresses obvious whitespace
CSS
Removes block comments and unnecessary whitespace
JavaScript
Removes block/line comments and unnecessary whitespace
Safety
Best for straightforward code; complex JavaScript needs testing

Simple CSS is easy to verify

body { color: red; } can be compacted by removing whitespace that CSS parsing does not need.

The JavaScript scanner does not fully understand contexts such as regular-expression literals. Use a parser-based minifier for critical bundles or test carefully.

Simple code is the safest fit

Straightforward CSS, HTML and ordinary JavaScript are the easiest cases to verify. Complex syntax deserves extra testing after minification.

Comments and obvious extra whitespace are removed

The tool reduces common source comments and spacing. Because it is intentionally lightweight, a smaller result is not proof that every complex script will still behave identically.

HTML uses text-based cleanup

Comments and obvious whitespace are collapsed rather than parsed through a browser DOM tree. Whitespace-sensitive inline content should therefore be visually checked.

Reduction is character-based

The reported percentage compares source and result string lengths. It does not estimate the eventual gzip or Brotli transfer size.

Keep the source copy

Treat the output as a derived artifact until it has passed functional tests; do not overwrite the only readable source with this quick minified version.

Related references: HTTP status codes · MIME types · Regex cheat sheet