Skip to main content
Tools Harbor

HTML / CSS / JS Minifier

Minify HTML, CSS and JavaScript to reduce file size for production.

Language

Strip bytes from HTML, CSS and JavaScript

Minification removes characters that a human needs for readability but a parser does not — whitespace, newlines, comments, optional semicolons. The output behaves identically but is smaller, so it loads faster over the network.

What this tool does

  • HTML — strips comments, collapses whitespace between tags and inside text nodes.
  • CSS — strips comments, removes optional whitespace around {}:;, collapses runs of whitespace.
  • JavaScript — strips // and /* */ comments, preserves string contents, collapses whitespace.

When to minify

  • Inline scripts and styles — anything you copy-paste into a page.
  • CMS embeds — platforms that don’t run a build step (WordPress blocks, Shopify Liquid, Webflow custom code).
  • Quick demos — squeeze a StackBlitz or CodePen example before sharing.

When to use a real build tool instead

For production JavaScript bundles — anything shipped to real users — use a proper minifier (terser, esbuild, swc). Those tools apply dead-code elimination, property mangling, scope hoisting and other optimizations that save far more bytes than whitespace stripping alone.

Privacy

The minifier runs entirely in your browser. Nothing is sent to a server, logged, or stored.

Frequently asked questions

Does the minifier rename variables or mangle code?
No. This minifier only strips comments and unnecessary whitespace. It does not rename variables, remove dead code, or apply tree-shaking. For aggressive optimization on production bundles, use a dedicated build tool like esbuild, terser or swc.
Is it safe to minify my production JavaScript with this?
For hand-authored snippets (inline scripts, small utilities, landing page code) it is safe and effective. For application bundles, let your build tooling handle it — modern bundlers produce smaller and safer output because they understand the AST.
What about source maps?
This tool does not emit source maps. If you need to debug minified output in production, use a real minifier that generates source maps (terser, esbuild).