Paste code to strip it down for production — minification runs locally in your browser and nothing is uploaded.
Minification here is text-based (removing comments and whitespace). It's reliable for most code, but for complex JavaScript with regex literals or template strings, test the output before shipping — your original stays in the box above untouched.
Frequently asked questions
Is the minified JavaScript safe to run?
Yes. The JS minifier only strips comments and collapses whitespace while preserving strings, template literals and regex contents, so behaviour is unchanged. It doesn't rename variables, so it won't break references — but for production builds a full tool like Terser compresses further.
Does minifying JSON validate it?
Yes. JSON is parsed and re-serialised, so invalid JSON is reported as an error rather than silently mangled.
Will HTML minifying break my page?
It removes comments (keeping IE conditional comments) and collapses whitespace between tags. This is safe for typical markup, though be mindful of significant whitespace inside <pre> or <textarea>.
Is my code uploaded?
No. All minification happens locally in your browser, so you can safely paste proprietary or sensitive code.
What this minifier does
- Strips comments and unnecessary whitespace from CSS, JavaScript, HTML, JSON and XML to shrink file size for faster loading.
- The JavaScript minifier is deliberately conservative — it removes comments and collapses whitespace while carefully preserving the contents of strings and template literals, so behaviour doesn't change. It does not rename variables or perform advanced optimisation (that's what build-time tools like Terser are for).
- JSON minifying re-parses and re-serialises, which also validates the JSON along the way.
- Everything runs in your browser — paste sensitive code safely, nothing is uploaded.
Why websites began shrinking source files
As the Web grew from small documents into applications, scripts and style sheets became larger. Minification removes unnecessary characters such as comments and formatting whitespace to reduce transfer size without intentionally changing behavior.
Minification is not compression
Minification rewrites source into a smaller textual form. Network compression such as gzip or Brotli works differently by encoding repeated patterns more efficiently. Production sites often benefit from both.