Code · Made a little simpler

JavaScript Minifier

Minify JavaScript on your device, optionally optimize expressions and generate a separate source map. Compare UTF-8 byte sizes and save the output files.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

JavaScript Minifier: how to use it

  1. Paste JavaScript or select a local source file. Leave optimization off to start with compact formatting.
  2. Enable a source map if you need to trace generated code, then select Minify JavaScript.
  3. Download minified.js and, when enabled, minified.js.map. Keep the two files together for debugging.

Limits and notes

Input can contain up to 1,000,000 UTF-16 code units. Local files must be valid UTF-8 and at most 4 MiB. Identifier mangling is disabled. Compression can simplify expressions and remove unused code when enabled. Comparisons show UTF-8 bytes before transfer compression.

How your privacy works →

JavaScript Minifier: common questions

Does the source map include the original text?

Original text is optional. Enable Include original source in map to add the input to the sourcesContent field.

Why is a very short script larger with a map?

Map generation appends a sourceMappingURL comment to the script. Its size can exceed whitespace savings for short inputs.

Guides