JavaScript Minifier — Compress JS Online, Free
Minify JavaScript online — remove comments, whitespace, and newlines. See byte savings. For production-grade minification (dead code, variable renaming), use Terser or esbuild. 100% local.
Last updated:
CommentsStrip JS comments and whitespace for a quick size estimate. For production minification, use Terser or esbuild.
Saved 39 bytes (28.9%)
Note: This is a basic whitespace+comment stripper. For production minification (dead code elimination, variable renaming), use Terser or esbuild.
function greet(name){const message = "Hello," + name + "!";console.log(message);return message;}What is JS Minifier?
JavaScript minification removes comments (// and /* */), collapses whitespace, and removes unnecessary semicolons and newlines. This is a basic minifier — it does NOT perform dead code elimination, variable renaming, or tree shaking. For production-grade minification, use Terser, esbuild, or UglifyJS. This tool is useful for quick estimates and one-off compression of small scripts.
How to minify JavaScript
- 1Paste your JavaScript code.
- 2View the minified output and byte savings.
- 3For production deployment, use a dedicated minification tool (Terser, esbuild).
Frequently Asked Questions
Is this a production-grade minifier?
No — this is a whitespace+comment stripper. For production minification (dead code elimination, variable renaming, tree shaking), use Terser, esbuild, or UglifyJS. This tool is ideal for quick size estimates and one-off compressions.
How much does JavaScript minification save?
For well-commented, readable JS, expect 30-50% reduction. For already-compact code, 5-15%. Semantically meaningful characters (keywords, identifiers, operators) can't be removed without changing the program.
Can I use this for minifying bundled JavaScript?
Yes — paste the bundled output from webpack, Vite, or esbuild to further strip format whitespace. Combined with tree-shaking and bundling, total size reductions of 60-80% are achievable.
Try Next
Meta Tag Preview
Preview how your page will appear in Google search results and social share cards on Facebook, Twitter/X, and LinkedIn. Parses <title>, meta description, canonical, and full Open Graph / Twitter Card tags with diagnostics. 100% local.
Related Tools
User Agent Parser
Parse User-Agent strings to identify browser, engine, operating system, and device. Instantly see what your own browser sends.
HTTP Status Codes
Complete reference of HTTP status codes with meanings, use cases, and RFC citations. Search 60+ codes from 100 Continue to 511 Network Authentication Required.
cURL Converter
Convert cURL commands to Python (requests), JavaScript (fetch), Node.js, Go (net/http), PHP, or Java (HttpClient). Parses -H, -d, --data-urlencode, -F, -u, --json and more. 100% local.
URL Parser
Parse any URL into scheme, host, port, path, and query parameters — or build a URL from scratch with a form. Great for debugging redirect chains, tracking pixels, and OAuth flows. 100% local.
CIDR Calculator
Calculate IPv4 subnets from CIDR notation online. Get network address, broadcast, netmask, wildcard, usable host range, IP class, and binary representation. 100% local — nothing leaves your browser.
Color Converter
Convert colors between HEX, RGB, HSL, and HSV instantly with a live color preview and copy-ready CSS strings. Free, no signup, runs entirely in your browser.