⚡
usefultools.dev
JS

JavaScript Minifier

NOVO

Minify JavaScript with Terser: compress and mangle code, see the size saved, and copy or download the result.

Funciona 100% no seu navegador — o que você insere nunca é enviado nem armazenado nos nossos servidores.

Esta ferramenta ainda não está totalmente traduzida, por isso parte do texto continua em inglês. A ferramenta funciona da mesma forma em todos os idiomas.

611 B
Compress
Mangle names
Output
Language

Minification is only as safe as the code. Code that uses eval, new Function, fn.name or reads property or variable names from strings can break, and with Top-level scope on, global names used by other scripts or inline onclick handlers are renamed. Always test the minified file.

⚡

Exemplos rápidos

Entradas típicas e os resultados que esta ferramenta gera.

Mangle
function add(first, second) { return first + second; }
function add(n,d){return n+d}
Compress
const msg = "a" + "b";
const msg="ab";
Dead code
if (false) { run(); } start();
start();
Comments
/*! v1.0 MIT */ // note let a = 1;
/*! v1.0 MIT */ let a=1;
Error
let x = ;
Line 1, column 9: Unexpected token: punc (;)
📖

Visão geral

This JavaScript minifier shrinks scripts with Terser, the same engine used by many build tools. It removes whitespace and comments, shortens local variable and function names, and simplifies expressions so the file downloads and parses faster.

Developers use it to compress a snippet, a bookmarklet or a legacy script without setting up a bundler. Choose compress passes, mangle and top-level options, an ECMAScript target (ES2015 to ES2022), ES module mode, which comments to keep and which names to preserve, and optionally generate a source map.

Everything runs in your browser. Your code is never uploaded, and you see the original size, minified size, percentage saved and a gzip estimate right away.

Por que usar esta ferramenta?

  • Smaller scripts with real Terser compression
  • Keep license comments, drop console calls
  • Source map output for easy debugging
  • Shows exact size and gzip savings
  • Private: code never leaves your browser
⭐

Recursos

🗜️

Compress and mangle

Inline code, remove dead branches and rename local variables, with 1 to 3 compress passes.

🧰

Fine-grained options

Drop console and debugger, keep function or class names, and protect specific identifiers.

🎯

ES target and modules

Pick ES2015, ES2017, ES2020 or ES2022 output and switch on ES module mode.

🗺️

Source maps

Generate a .map file and a sourceMappingURL comment so minified code stays debuggable.

📊

Size report

Original and minified bytes, percent saved and a gzip estimate for both.

📂

Upload and download

Drop a .js file in, then copy the result or download it as .min.js.

🛠️

Como usar

1

Add your code

Paste JavaScript into the input box, drop a .js file onto it, or press Sample.

2

Set the options

Tick Compress and Mangle, choose the comments to keep, the ECMAScript target and ES module mode.

3

Minify

Press Minify, or leave Minify as I type on. Check the size saved and any syntax error with its line and column.

4

Copy or download

Press Copy or Download .min.js, and download the .map file if you generated a source map.

🤔

Perguntas frequentes