مرکزی مواد پر جائیں
Tools Star Hub

JavaScript منیفائر

پارسر کے ذریعے اپنے براؤزر میں JavaScript مختصر کریں۔ کوڈ چلایا نہیں جاتا۔

ٹول لوڈ ہو رہا ہے…

یہ ٹول آپ کے براؤزر میں چلتا ہے۔ ان پٹ، فائلیں اور بنائی گئی ویلیوز اسی ڈیوائس پر رہتی ہیں۔ پسندیدہ اور حال ہی میں استعمال شدہ ٹولز، اگر آپ انہیں استعمال کریں، لوکل اسٹوریج میں صرف ٹولز کے نام محفوظ کرتے ہیں — کبھی پاس ورڈ، دستاویزات یا QR کا مواد نہیں۔ رازداری کی پالیسی دیکھیں۔

اس ٹول کی تفصیلی رہنمائی (استعمال کا طریقہ، مثالیں اور عام سوالات) فی الحال انگریزی میں ہے۔

What this tool does

Parse JavaScript with Terser, then compress and mangle it. Use it when a small script should be shorter and you want a parser rather than find-and-replace. The script is not run, and TypeScript comes back as an error.

How to use

  1. Paste JavaScript into the left box.
  2. Press Minify. A parser compresses and mangles the source without running it.
  3. Copy the result or clear both boxes. Syntax errors are shown instead of output.

Examples

  • A small function

    function greet(name) { return "Hello, " + name; } is parsed, then shortened by removing whitespace and renaming locals where safe.

  • Invalid source

    If the parser cannot read the file, you get an error. The tool does not try to “fix” broken JavaScript.

How it works

JavaScript cannot be minified safely with simple find-and-replace. This tool uses Terser in the browser to parse the source, then compress and mangle it. Your code is not executed with eval or new Function. Constant-expression evaluation is turned off so user expressions are not run during minify. Very large files are rejected so the tab stays responsive.

Limitations

Terser parses the source, then compresses and mangles it. The script is not run. TypeScript, and JavaScript the parser cannot read, come back as an error rather than a shorter file. Constant expressions are not evaluated during the pass.

See the disclaimer for what these tools do not cover.

FAQ

Is the JavaScript Minifier free?
Yes. Parsing and minifying JavaScript in this browser is free, with no account.
Does this run my JavaScript?
No. The source is parsed and rewritten. It is not executed in this page.
Will every program minify?
Only syntactically valid JavaScript. Browser-incompatible syntax or truncated files will fail with a parser error.
Is my input sent to a server?
No. The source is minified in this tab. It is not uploaded and not saved in local storage.