Developer Tools Runs in your browser Free · no account

JavaScript Minifier

The JavaScript minifier removes comments and unnecessary whitespace while leaving every identifier, string and regular expression untouched. It is a safe, conservative squeeze rather than a full compressor, so the code behaves exactly as before.

Options
JavaScript 0 characters
Minified JavaScript

Your result will appear here.

Not sure where to start? Use Load example.

Results update automatically and are calculated on your device. Nothing you type is sent to a server.

Runs in your browser. Processing happens entirely in your browser. Nothing you enter is sent to Delimiter.live.

How to use the JavaScript Minifier

  1. Paste the script you want to compress.
  2. Decide whether comments should be removed.
  3. Check the size saving and copy or download the result.

Example

Input
// hi
function a() {
  return 1;
}
Output
function a(){return 1;}

Common use cases

  • Compressing a small inline script in a project without a build pipeline.
  • Stripping developer comments before shipping a snippet.
  • Reducing the size of a script stored in a CMS field.

Limitations and things to watch for

  • This minifier only removes comments and whitespace. It does not rename variables, drop dead code, fold constants or perform any of the transformations a compiler such as Terser or esbuild applies, so the saving is smaller — typically 20 to 40 percent rather than 60 or more.
  • Whitespace that is required — between keywords and identifiers, and where removing it would trigger automatic semicolon insertion — is always preserved.
  • For production bundles, use a real build tool. This is for small scripts and quick fixes.

Frequently asked questions

Is it safe to minify unfamiliar code with this?
Yes, because the transformation is deliberately conservative: nothing is renamed or removed except comments and redundant whitespace, and line breaks that automatic semicolon insertion depends on are preserved.
Why is the saving smaller than my build tool achieves?
Real minifiers also shorten variable names and remove unreachable code. That requires full parsing and scope analysis, which is out of scope for a browser utility that must never break your script.
Should I use this for production bundles?
No. Use esbuild, Terser or your framework build step for production. This tool is for one-off snippets and inline scripts.

Share this tool