Request a tool
DEVELOPER TOOLS · FREE ONLINE TOOL

JavaScript Minifier

Real Terser-powered JS minification: parse, compress, mangleReadable JavaScript is written for humans: descriptive names, comments, generous line breaks. Browsers need none of that. This minifier compresses your script into its smallest valid form, producing dense code that executes identically while weighing measurably less.

✓ Free to use✓ No sign-up✓ Ready in your browser
// JAVASCRIPT MINIFIER · GET STARTED

Use JavaScript Minifier

Real Terser-powered JS minification: parse, compress, mangle

Options

Powered by Terser: real parsing, dead-code removal, and compression. Runs in your browser.

// JAVASCRIPT MINIFIER · HOW IT WORKS

How to use the JavaScript Minifier

01

Paste JavaScript

Paste your JavaScript into the box.

02

Pick options

Choose whether to mangle variable names.

03

Minify and copy

Click "Minify JavaScript", then copy or download the result.

// JAVASCRIPT MINIFIER · ABOUT THIS TOOL

About the JavaScript Minifier

Simple whitespace strippers leave most of the savings on the table and can break code. This tool runs Terser, the same minifier behind most production build pipelines, directly in your browser. Because it truly parses your code, it compresses expressions, removes dead code and reports syntax errors clearly. Production-grade minification without installing anything.

Where it helps most

Outside the build pipeline.

CMS code boxes

A snippet destined for a CMS custom-code box, where no bundler ever runs.

Userscripts and bookmarklets

Userscripts and bookmarklets that ship as a single compressed file for easy install.

Embed codes

Third-party embed code you were told to paste as-is, slimmed down before it goes live.

Quick experiments

Experiments where configuring a bundler would take longer than the task itself takes.

Minifying safely

Two habits keep it trouble-free.

Keep the source

Always keep the readable source as the file you edit; debugging compressed code directly is miserable.

Test after replacing

Breakage after minifying almost always exposes a pre-existing syntax quirk, so test the page once.

Pipeline projects

Projects with a build pipeline already minify on every deploy; those tools should stay the source of truth.

JavaScript Minifier: private by design

Everything runs in your browser. Your code never leaves your device, no signup needed.

// JAVASCRIPT MINIFIER · COMMON QUESTIONS

JavaScript Minifier FAQs

Hand-written scripts typically shrink by 30 to 50 percent, since comments, descriptive names, and formatting make up a large share of the source. Already-minified libraries will barely change, so there is no benefit in minifying those twice.