Web Tools · Free · No signup
Paste JavaScript and get a leaner, still-readable-safe version in one click: comments are stripped and needless whitespace collapses, while strings, template literals and regular expressions are preserved untouched. Newlines are kept when they carry meaning (ASI-safe), and nothing is ever renamed. A byte-accurate report shows your savings — all of it computed locally in your browser.
🔒 100% private: everything runs inside your browser — nothing is uploaded, stored or logged.
Newlines that could carry Automatic Semicolon Insertion are preserved, so code written without semicolons keeps working.
Single quotes, double quotes, template literals and regular expressions — including escaped slashes like /a\// — are detected and never touched.
Identifiers, properties and globals keep their names — a deliberate safety choice that keeps the tool predictable.
Savings are measured in real UTF-8 bytes, straight after each run.
Plain JavaScript in your browser — nothing is uploaded, stored or logged.
Input & output. Any ES5+ JavaScript works — utility scripts, inline embeds, config files. Output keeps one newline where a line break could change meaning, which keeps the result safe but slightly larger than a full build-tool minifier would produce.
This is a safe text-level minifier: it removes comments and whitespace only — no identifier mangling, no dead-code elimination, no transpilation. The regex-vs-division detection uses the classic token heuristic and may need a hand on exotic code. For production bundles with aggressive optimization, use a build-time tool like Terser or esbuild — and as with any minifier, always test the output.
No. Renaming (mangling) is the main source of breakage in quick minifiers, so this tool never touches identifiers — names stay exactly as written.
Yes. Newlines that could matter for Automatic Semicolon Insertion are preserved, so ASI-dependent code keeps its behavior.
A token-level heuristic (the classic JSMin approach) decides whether a / starts a regex or is a division; regex literals are then copied byte-for-byte, including escaped slashes.
For small scripts and widgets, yes. For large production bundles you want an AST-based build tool (Terser, esbuild) — this tool stays deliberately conservative to stay safe.
No. The whole minification runs locally in your browser — nothing is sent, stored or logged.
Keep going
Shrink HTML online — comments and extra whitespace out, markup intact.
Use Tool →
Minify stylesheets online — comments, whitespace and zero-values trimmed.
Use Tool →
Format, validate and minify JSON with clear error locations.
Use Tool →
Encode or decode Base64 text with full Unicode and URL-safe support.
Use Tool →
Create a valid robots.txt from presets and custom rules in seconds.
Use Tool →
On mobile?
This tool runs in any mobile browser — no app needed. And for the image & PDF side of the toolbox, the CompressoPanda Android app ships 36 tools that run with no connection at all: compression to target size, editing and PDF essentials included.