JavaScript Minifier
Quick JS minifier that strips comments and collapses whitespace. Best for trusted, simple code snippets.
JavaScript Minifier — A lightweight JavaScript minifier that strips block and line comments and collapses whitespace. Useful for one-off scripts, bookmarklets, and snippets where you want a quick size reduction without setting up a build pipeline.
Your JavaScript is processed locally and never sent over the network.
What is javascript minifier?
A lightweight JavaScript minifier that strips block and line comments and collapses whitespace. Useful for one-off scripts, bookmarklets, and snippets where you want a quick size reduction without setting up a build pipeline.
CAUTION: This is a syntactic minifier, not a real parser. It does not understand strings, template literals, or regular expressions, so it can mangle code that contains // or /* * / inside those constructs. For production code, use Terser, esbuild, or SWC.
How to use it
-
Paste your JS
A snippet, a function, or a small module.
-
Read the minified output
Comments and excess whitespace are stripped.
-
Copy
Grab the result for use elsewhere.
Examples
Comment stripping
Block and line comments go away.
/* greet */ const greet = (name) => {
console.log("hi", name); // say hi
}; Result: const greet = (name) => { console.log("hi", name); };
Whitespace collapse
Multiple spaces and newlines become one.
const a = 1;
Result: const a = 1;
Frequently asked questions
Related tools
HTML Minifier
Shrink HTML by stripping comments and collapsing whitespace. See byte savings in real time.
CSS Minifier
Shrink CSS by stripping comments, collapsing whitespace, and tightening punctuation. See byte savings live.
JSON Formatter
Format, beautify, and validate JSON with adjustable indentation — instantly in your browser.