🧰Tools 🗜️ Compression🔄 Conversion✏️ Editing📄 PDF Tools⚡ Optimization🌐 Web Tools🧰 All Tools (69)
📱 Android App 📝 Blog 👋 About

Web Tools · Free · No signup

Minify JavaScript — Comments Out, Logic Intact

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.

How it works

  1. Paste your JavaScript — a utility file, a widget, an inline script.
  2. Hit Minify — comments and extra whitespace are removed in one safe pass.
  3. Check the savings report: original bytes, minified bytes, percentage saved.
  4. Copy the result or download it as a .js file — then test it in your page.

Features

ASI-safe by design

Newlines that could carry Automatic Semicolon Insertion are preserved, so code written without semicolons keeps working.

Strings, templates & regex preserved

Single quotes, double quotes, template literals and regular expressions — including escaped slashes like /a\// — are detected and never touched.

No renaming, ever

Identifiers, properties and globals keep their names — a deliberate safety choice that keeps the tool predictable.

Byte-accurate report

Savings are measured in real UTF-8 bytes, straight after each run.

100% private

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.

Common use cases

Limitations (honest ones)

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.

Frequently asked questions

Will it rename my variables or functions?

No. Renaming (mangling) is the main source of breakage in quick minifiers, so this tool never touches identifiers — names stay exactly as written.

Is it safe for code without semicolons?

Yes. Newlines that could matter for Automatic Semicolon Insertion are preserved, so ASI-dependent code keeps its behavior.

How does it avoid breaking regular expressions?

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.

Is the output production-ready?

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.

Is my JavaScript uploaded anywhere?

No. The whole minification runs locally in your browser — nothing is sent, stored or logged.

Keep going

Related tools

CompressoPanda Android app icon

On mobile?

Working from your phone?

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.