Diese Seite ist noch nicht auf Deutsch verfügbar, daher zeigen wir die englische Version.

JavaScript Minifier — Minify JS Online

Paste JavaScript and get production-ready minified code from Terser — the same engine used by Vite, webpack and Rollup — with real before/after and gzipped sizes.

Aktualisiert am
Open file

Deine Daten verlassen nie deinen Computer. Die Verarbeitung erfolgt zu 100 % lokal im Browser.

So nutzt du: JavaScript Minifier

  1. Paste your JavaScript or open a .js file.
  2. Keep Compress and Mangle names on for the smallest output; tick ES module for code with import/export.
  3. Optionally remove console calls and choose which comments to keep.
  4. Copy the result or download it as .min.js.

What does a JavaScript minifier do?

Minification makes JavaScript smaller without changing what it does. It removes whitespace and comments, shortens local variable and function names, and rewrites code into shorter equivalent forms. Smaller files download and parse faster, which helps page speed and Core Web Vitals — especially on mobile.

This tool runs Terser, the minifier behind Vite, webpack and Rollup, directly in your browser.

The main options

OptionWhat it doesRisk
CompressRemoves unreachable code, folds constants (60 * 60 → 3600), simplifies conditions and joins statementsVery low
Mangle namesRenames local variables and parameters to one or two lettersLow — code that uses eval or Function.name may break
Mangle top-levelAlso renames global functions and variablesBreaks code that other scripts call by name
ES moduleParses import/export and enables strict mode and top-level manglingNone for real modules
Remove console.*Drops console.log and similar callsRemoves logs you may want in production

Minification vs compression

Minification and gzip/Brotli work together. Minifying typically removes 30–60 % of a file; the server’s gzip or Brotli compression then shrinks what is left by another 60–70 %. The stats above show both: the minified size and the gzipped size that will actually travel over the network.

Keep license comments

Open-source licenses such as MIT require the copyright notice to stay with the code. By convention these comments start with /*! or contain @license, and the default setting keeps them.

Troubleshooting

  • Syntax error: the line and column are shown. TypeScript and JSX must be compiled to JavaScript first.
  • Code stops working after mangling: turn off Mangle top-level names; if that does not help, check for eval or code that reads function names.
  • Need a readable version again? Use the JavaScript formatter to beautify minified code.

Auch gesucht als: minify js, js minifier, javascript compressor, uglify js online, terser online, compress javascript, minify es6.

Passende Tools zu: JavaScript Minifier

  • HTML Minifier — Shrink HTML pages and templates by removing comments and redundant whitespace, minifying inline <style> and <script>, and cleaning up attributes — while keeping the layout identical.
  • CSS Minifier — Paste a stylesheet to shrink it instantly.
  • JSON Minifier — Remove all unnecessary whitespace from JSON, validate it at the same time and see exactly how many bytes you save — before and after gzip.
  • Website Compression Test — Enter a URL to see which compression your server sends for each Accept-Encoding, how many bytes it saves, whether its CSS and JavaScript are compressed, and what Brotli could save.

Häufige Fragen

Is Terser better than UglifyJS?
Terser is a maintained fork of UglifyJS that understands modern JavaScript (ES2015+), including classes, arrow functions, async/await and modules. UglifyJS does not support all modern syntax.
Will minified code behave exactly the same?
Yes for normal code. Mangling can break code that relies on eval, with or function names at runtime; turn mangling off for such code.
Can it minify TypeScript or JSX?
No — compile TypeScript or JSX to plain JavaScript first (with tsc, esbuild or Babel), then minify the output.
Is my code uploaded?
No. Terser runs entirely in your browser; your source code never leaves your device.
How do I un-minify JavaScript?
Paste it into the JavaScript formatter. Formatting restores indentation and line breaks, but mangled variable names cannot be recovered without a source map.
Kann ich JavaScript Minifier als Web-App installieren und offline nutzen?
Ja. JavaScript Minifier ist eine installierbare Web-App (PWA) – sie wird über Ihren Browser installiert und nicht aus einem App-Store heruntergeladen. Klicken Sie oben auf dieser Seite in Chrome oder Edge (Windows, macOS, Linux, ChromeOS) auf „App installieren“ oder verwenden Sie auf Android-Geräten „Teilen“ → „Zum Startbildschirm hinzufügen“ auf dem iPhone und iPad bzw. „Datei“ → „Zum Dock hinzufügen“ in Safari 17+ auf einem Mac. Die App öffnet sich dann in einem eigenen Fenster mit einem eigenen Symbol, und da sie vollständig in Ihrem Browser ausgeführt wird, funktioniert sie auch offline. Firefox auf dem Desktop kann keine Web-Apps installieren. So funktioniert die Installation.

Ähnliche Tools