ToolDashy

JS Minifier

Minify JavaScript code to cut its file size for production — removes whitespace, comments and shortens variable names using Terser, entirely in your browser.

Everything you enter is processed in your browser and isn't sent to our servers.

How to use js minifier

  1. 1Paste your JavaScript into the input box.
  2. 2Click Minify.
  3. 3Compare the original and minified size, and the percentage saved.
  4. 4Copy the result or download it as a .js file.

About this tool

Minification strips everything a JavaScript file doesn't need to run — whitespace, comments, and long variable names — replacing them with a functionally identical but far more compact version, which reduces how much a browser needs to download.

This tool uses Terser, the same minifier used by most modern JavaScript build tools (including webpack and Rollup's production builds), so the output matches what a real production bundler would produce.

Minifying doesn't run or evaluate your code in any way — it's purely a text transformation performed by Terser's parser, so pasting code here never executes it.

Frequently asked questions

Valid JavaScript should minify without changing behavior — Terser is a widely used, production-grade minifier. If your code has a syntax error, minification will fail and show a clear message instead of silently producing broken output.

Related tools