About the JavaScript Minifier
A conservative JavaScript minifier that removes comments and collapses whitespace while preserving strings, regexes and template literals — safe rather than aggressive, with before/after size stats.
For quick wins on small scripts without setting up a build pipeline.
How to use the JavaScript Minifier
- Paste your JavaScript.
- Click "Minify".
- Copy the smaller output; verify it runs as expected.
Common uses
Shrinking small scripts without build tools
Compacting inline scripts
Quick size estimates
Frequently asked questions
Is this as aggressive as Terser?
No — it deliberately avoids renaming variables or rewriting logic, trading a few percent of size for guaranteed safety.
Are strings and regexes safe?
Yes — the minifier tracks string, template and regex contexts and never alters their contents.
Related tools
JSON Formatter & Validator
Beautify, validate and minify JSON with clear error locations.
Developer ToolsUUID Generator
Generate cryptographically secure UUID v4 identifiers, in bulk.
Developer ToolsRegex Tester
Test regular expressions live with match highlighting and a cheat sheet.
Developer ToolsMarkdown Editor & Preview
Write Markdown with a live side-by-side HTML preview.
Developer Tools