Code tool

JavaScript Minifier

Paste JavaScript, choose safe cleanup options, and copy or download a compact result without uploading your source.

In-browser processingNo account requiredPrivacy details ↗

Up to 500,000 characters. Processing stays in this browser.

A QUICK WALKTHROUGH

How to use this tool

  1. Paste JavaScript into the editor or load the sample.
  2. Choose whether comments and final semicolons should be removed, then inspect the size change.
  3. Copy the minified script or download it as a JavaScript file.

Conservative browser-side minification

This tool removes comments outside strings and template literals, collapses safe whitespace, and optionally removes semicolons before closing braces. Your code stays on this device and is never sent to a server.

Keep a readable source file

The result is intended for quick local use. Keep formatted source and source maps in your project, and use a tested JavaScript build pipeline for production code, transpilation, bundling, and advanced syntax.

GOOD TO KNOW

Common questions

Does this rewrite or optimize my JavaScript?

No. It performs a focused text transformation and does not rename variables, reorder code, transpile syntax, or run a JavaScript parser.

Are strings and template literals preserved?

Yes. Text inside single-quoted, double-quoted, and template literal strings is kept, including escaped characters and interpolation expressions.

Is my code uploaded?

No. Minification, copying, and download preparation happen locally in your browser.

Can I use this for production builds?

Use a tested build tool for production. This page is useful for a quick compact copy and does not generate source maps.