JavaScript Minifier
FreeMinify JavaScript code to reduce bundle size
function add(a,b){return a+b;}const x=add(1,2);About JavaScript Minifier
JavaScript is often the heaviest asset on a page, and source code carries whitespace, comments, and long names that bloat the bytes sent to users. The JavaScript Minifier compresses your code by removing unnecessary characters and shortening local names where safe, producing a much smaller file that runs exactly the same.
Paste your script and the tool returns minified output ready to ship. It's free, runs in your browser, and works instantly with no signup. Use it to shrink a standalone script, compress a utility before embedding it, or quickly reduce bundle size without configuring a full build chain, cutting download size and helping your pages load and execute faster for everyone.
Common uses
- Shrink a standalone script before adding it to a page to cut download size
- Compress a small library or utility you're embedding inline
- Quickly reduce file size without setting up a bundler
- Minify code for a snippet or widget distributed to other sites
- Trim a build artifact further before deploying it
How to use
- 1
Enter your details
Type or paste your content and pick a type using the fields below.
- 2
Customise the output
Adjust the available options — size, colour and other settings — to suit your needs.
- 3
Download or copy
Your result is generated instantly in your browser. Download it or copy it directly to your device.
Why ToolHub?
- Clean readable code
- Standards-compliant formatting
- One-click beautify
FAQ
Does minifying change what my code does?
No. It removes whitespace and comments and safely shortens names, but the runtime behavior stays the same.
Can I get the original code back?
Not exactly. Comments and original variable names are lost. Running it through the JavaScript Formatter restores indentation but not the original names.
Will it break code that relies on function names?
Local names are shortened safely, but if you rely on specific names via reflection or strings, verify the output before shipping.
Does it handle modern syntax?
Modern JavaScript is supported. For very specialized build needs you may still prefer a dedicated bundler step.
Can I use JavaScript Minifier on mobile?
Yes — ToolHub is fully responsive and works on iPhone, Android, tablets and all modern browsers. No app install needed.