JS minifier
What this JS minifier does
It tightens JavaScript by dropping most whitespace and line comments, sometimes shortening identifier names when the minifier is advanced enough. The goal is smaller download and parse cost, not secrecy—minified code is still fully recoverable for determined readers. Do not treat this as a substitute for environment variables, API auth, or threat modeling.
When to use it
Use it to ballpark how much a script could shrink, to prep a throwaway embed, or to compare a vendor bundle against your own. Real apps should minify in the production build with source maps and tree shaking. After minifying, if you need structure back, use your VCS or the original file—round-tripping through JSON validator & beautifier is for data, not JS repair.
Worked example
A third-party snippet clocks 90KB with comments. You minify a copy, show the team a 35% drop, and decide whether to self-host a cleaned build or async-load it—now the discussion is data-driven.
Frequently asked questions
Why did my file error after minify?
ASI edge cases, template literals, and JSX all need language-aware minifiers. Online tools may assume plain script, not full project syntax.
Is this safe for TypeScript or Vue SFCs?
No. Compile or transpile first, then minify the emitted JS your browser actually runs.
Does minify equal obfuscate?
No. True obfuscators mangle control flow; minifiers mostly delete air. Neither replaces server-side secret handling.