This tool strips comments and unnecessary whitespace from JavaScript to reduce file size, while carefully
tracking strings, template literals, and regular expressions so a // or /* */-looking
sequence inside one of those is never mistaken for a real comment and stripped.
// line comments and /* */ block comments.This is comment-and-whitespace minification, not full AST-based minification. It won't rename variables, shorten function names, or restructure control flow the way build-time tools like Terser or esbuild do — those need a real JavaScript parser and carry more risk of subtly changing behavior. This tool is the safe subset: purely cosmetic size reduction with no semantic changes.
Reach for this when you need a quick one-off size check or a lightweight script with no build pipeline behind it. For a production bundle, use a real bundler-integrated minifier — it will do everything this does plus much more, and it runs as part of your build rather than manually.
Need the reverse? Format minified code back to readable with the JS Formatter.
100% client-side — your source code is never uploaded.