Skip to main content

JavaScript Minifier

Compress JavaScript by removing comments and whitespace.

What does this tool do?

Direct answerJavaScript Minifier removes comments and collapses whitespace while preserving string literals exactly.
Key factThis is a safe whitespace minifier — it does not rename variables or dead-code-eliminate.
ProcessingRuns locally in your browser; no data is sent to a server.

How to use

  1. Paste JavaScript into the input.
  2. Click Minify JavaScript.
  3. Copy the compressed code.

Who is this for?

This tool was built for people who need a fast answer in the browser — no install, no account, no data leaving the device.

Developers formatting API responses or config files, analysts inspecting minified payloads, and students learning structured data formats. If you have ever squinted at a one-line blob hoping to find a missing brace, this page is for you.

Frequently asked questions

Does it rename variables?

No. It only removes whitespace and comments, so the output is always behaviorally identical.

Are strings preserved exactly?

Yes, including internal spaces — string contents are tokenized and never modified.

How does it compare to terser?

Terser also mangles names and removes dead code for deeper compression; this tool is whitespace-only and dependency-free.

More tools in this category