JavaScript Minifier

Minify JavaScript online with Terser. Keep variable names, URL strings and license comments while removing unnecessary formatting.

JavaScript Minifier uses Terser to compact parsed JavaScript. It preserves identifier names and keeps compression disabled, so you can make a snippet smaller without applying aggressive code transformations.

Input
Output

When to use JavaScript Minifier

  • Shrinking example scripts
  • Embedding tiny helpers in experiments
  • Comparing readable vs compact length

Example

Input

const url = "https://example.com/a//b";
console.log(url);

Output

const url="https://example.com/a//b";console.log(url);

How to use

  1. Paste readable JS. Keep the original for debugging.
  2. Minify. Run to collapse whitespace.
  3. Use compact output. Paste where a shorter snippet helps.

Processing and limitations

Uses Terser with compression and name mangling disabled. It compacts syntax while keeping identifiers; /*! license */ comments are retained. It does not bundle imports, transpile for older browsers or hide secrets.

Reference

Benefits

  • Free to use—no account required
  • Runs in your browser
  • Instant results with no software install
  • Basic processing does not upload your content to a server
  • Keep readable source and test the compact output. Imports are not bundled and code is not transpiled for older browsers.

Not the same as

For readability, beautify first. For syntax errors, validate.

Related tools