100% Free In-browser Instant minify

JS Minifier Free Online

Remove comments, collapse whitespace and compact JavaScript code instantly. Paste your JS or upload a .js file — all processing runs inside your browser, your code is never sent to a server.

Drop a .js file here or click to browse
Never uploaded · How it works

Minify JavaScript in 3 steps

1

Paste or upload

Paste your JavaScript into the input box, or drop a .js file directly onto the upload zone.

2

Auto-minify

The minifier runs instantly as you type, stripping comments and collapsing whitespace while preserving string literals.

3

Copy or download

Copy the minified JavaScript to your clipboard or download it as a .min.js file ready to deploy.

Minified JS for production

Whitespace and comment removal for JavaScript. ES6+ syntax supported. Your proprietary business logic and API integrations never leave your browser.

100% Private
Files never uploaded
Always Free
No account needed
Instant Results
No upload wait time
No Limits
Batch process freely
Feature JustDownSize Others
Price Always free Paid plans
File uploads Never uploaded Sent to server
Daily limit Unlimited 5–20/day free
Account needed No signup Registration
Watermarks None, ever On free tier

Minify JavaScript for Faster Page Loads

Whitespace and Comment Removal

Removes indentation, newlines, and comments from JavaScript. The resulting code is functionally identical but significantly smaller.

Size Reduction Metrics

Shows original size, minified size, and percentage reduction. Typical vanilla JavaScript minification achieves 30–60% size reduction depending on comment density and indentation.

Browser-Only Processing

JavaScript minification runs in your browser. Your proprietary code, API integrations, and business logic never upload to a server.

One-Click Copy to Clipboard

Copy the minified JavaScript with one click. Paste directly into your deployment pipeline or HTML script tag.

ES6+ Syntax Support

Handles modern JavaScript including arrow functions, template literals, destructuring, and async/await without mangling the syntax.

Bookmarklet and Snippet Optimization

Useful for minifying small JavaScript snippets for use as bookmarklets, inline script tags, or widget embed codes.

Why JavaScript Minification Matters

Page Load Time and Lighthouse Score

Unminified JavaScript is flagged by Lighthouse under 'Reduce unused JavaScript' and 'Render-blocking resources.' Serving minified JS reduces parse time and total blocking time — both measured by Core Web Vitals.

Legacy Projects Without Build Tools

Projects built without a modern bundler (Webpack, Rollup, Vite, Parcel) have no automatic minification step. Manually minifying JavaScript before FTP deployment achieves the same optimization without requiring tooling changes.

Third-Party Script Embeds

Widget developers and embed code providers should serve minified JavaScript from their CDN. Manually minifying small tracking scripts, chat widgets, or form embeds before distributing reduces the impact on host pages.

WordPress Plugin and Theme Development

WordPress JavaScript files need to be available in both .js (development) and .min.js (production) variants. Browser-based minification produces the .min.js version without needing a local Node.js build environment.

Frequently asked questions

JS minification removes all characters that are not required for the code to execute correctly. This includes single-line comments (// …), multi-line block comments (/* … */), and excess whitespace/newlines. String literals (single, double, and template quotes) are preserved exactly.

Our minifier is careful to preserve string contents and avoid breaking syntax. It does not rename variables or perform dead code elimination — it only removes whitespace and comments. For large or complex scripts always test the minified output before deploying to production.

No. All minification runs entirely inside your browser using JavaScript. Your code is never sent to any server and never leaves your device. This makes the tool safe even for proprietary or confidential source code.

Typical results range from 20–50% size reduction depending on how much whitespace and how many comments your script contains. Combined with gzip or Brotli compression on your server, total transfer savings can exceed 70%.

Yes. The minifier uses a state-machine tokenizer that recognises single-quote, double-quote, and template-literal (`…`) strings and skips them entirely during whitespace collapsing. Simple regular expression literals are also handled with care.

JavaScript Minifier Online: Compress JS Files Without npm

JavaScript has a cost that CSS doesn't: every byte must be downloaded, parsed, compiled, and then executed on the main thread before your page becomes interactive. A 400 KB JS bundle and its 180 KB minified equivalent do the same thing — but the smaller version reaches that interactive state faster, with less main-thread blocking time. For users on mid-range Android devices over 4G, that gap is often measured in full seconds.

This tool minifies JavaScript entirely in your browser. Paste your code, click minify, copy the output. No uploads, no accounts, no waiting.

What the minifier removes

Single-line comments. Every // comment like this is stripped. The parser tracks character position carefully — a // inside a string literal ("http://example.com") is left alone.

Block comments. /* … */ comments are removed, including JSDoc blocks. If you need to preserve a license header (many minified files must retain /*! license */ comments), copy it back in manually after minification.

Whitespace and newlines. Indentation, blank lines, and spaces around operators are collapsed. The state machine tokenises the source into regions — code, string literals (single-quoted, double-quoted, template literals), regex literals, and comments — and only strips whitespace from code regions. String content is never touched.

The combined effect varies by codebase, but a well-commented, readable JavaScript file typically reduces 40–60% in size from whitespace and comment removal alone.

Minification, uglification, and bundling — the differences

These three terms get conflated but they're distinct operations.

Minification removes whitespace and comments. The variable and function names stay unchanged. The code is smaller but still readable if you format it. That's what this tool does.

Uglification (the UglifyJS-style step) goes further: it renames local variables to single letters (function calculateTotal(items) becomes function a(b)), shortens property names where safe, and inlines single-use variables. Tools like Terser, UglifyJS, and esbuild do this. The size savings are significant — another 15–30% on top of basic minification — but the output is intentionally harder to reverse-engineer.

Bundling is a separate concern. Webpack, Rollup, and Vite combine multiple ES module files into one (or a few) output files, removing unused exports through tree-shaking, then apply minification/uglification as a final pass. If you're running a bundler, it handles minification automatically.

When this tool is the right choice

Build pipeline tools are the right call for production applications. But this online JS minifier is faster and more convenient in several scenarios:

You're self-hosting a third-party library and the CDN version is unexpectedly large. You have a small vanilla JS script on a static HTML page with no build process. You want to quickly check how much of a script's size is comments and whitespace. You're working on a client's server where you can't install Node.js. In all these cases, pasting into a browser tool is faster than configuring a build step.

JavaScript and Core Web Vitals

Google measures Total Blocking Time (TBT) and Time to Interactive (TTI) as part of its Core Web Vitals and ranking signals. Both metrics are directly affected by JavaScript payload size and parse time. Lighthouse's "Minify JavaScript" audit flags savings above around 2 KB. On shared hosting or budget servers where server-side compression isn't enabled, those savings are particularly valuable.

Pairing JS minification with other asset optimisations compounds the effect. A minified CSS file reduces render-blocking time; a CSS minifier handles that side. For HTML documents with embedded scripts and inline styles, running them through an HTML cleaner first removes noise before you minify. If your project includes Markdown-generated documentation files that ship as static HTML, converting and minifying those through a Markdown to HTML converter also reduces payload.

Safe minification: what won't break

Whitespace and comment removal is safe for all valid JavaScript. The only cases where a basic minifier can introduce bugs are edge cases in very old code: relying on automatic semicolon insertion in positions where a missing newline creates ambiguity, or using with() statements. Modern JavaScript, written to ES5 or later standards, minifies cleanly every time.

Keeping a source copy

Minified JavaScript is unreadable. Before running this tool, confirm you have the original source saved. The standard convention is script.js (source) and script.min.js (output). If you're self-hosting a third-party library that shipped only as a minified file and you need to read or modify it, browser DevTools source map support (if the library ships with a .map file) is the right approach — not trying to reverse the minification manually.

For projects that use multiple small JavaScript files, concatenating them before minifying produces better compression results than minifying each file individually. The minifier can remove cross-file whitespace, and Gzip compression finds more repeated patterns across a larger input. If your setup uses a CDN that handles concatenation, run the minifier on the combined output.