OxyPages

Free Online JavaScript Minifier

Paste JavaScript and get a smaller file back, with the saving shown in bytes.

Free. No account. Live in seconds.

Original 2.3 KB minified to minified 0 B

100% smaller (2.3 KB saved)

Working out the gzipped size…

JavaScript
Minified
A page showing the minified code and the bytes saved. Free. No account.

How It Works

How To Use The JavaScript Minifier

  1. 1

    Paste Or Drop Your JavaScript

    Paste the script into the left pane, or drop a .js file onto it. Everything runs in your browser, so nothing is uploaded.

  2. 2

    Choose How Hard To Squeeze

    Open Options to switch compression, name shortening, keep function names, keep licence comments, safe mode and the output syntax. Small files minify by themselves; large ones wait for the Minify button.

  3. 3

    Check The Saving, Then Take It

    The strip shows the original size, the minified size, the percentage saved and the gzipped size of both. Copy the result, download it as a .min.js file, or publish a share page in one click.

About This Tool

Minify JavaScript With A Real Compressor

Terser, running entirely in your browser, with the saving shown in plain bytes and in gzipped bytes.

This JavaScript minifier is the terser engine - the compressor behind many JavaScript build tools, and the successor to UglifyJS - running as an ordinary web page. It parses your script properly, so it does three things a search-and-replace never could: it removes comments and whitespace, it compresses the code itself (unused variables, unreachable branches, expressions that can be written shorter), and it renames local variables and function arguments to single letters. What comes back is the same program in fewer bytes, ready to copy, download or publish.

Who It Is For

Most people who land here are holding a script somebody or something else wrote: the widget ChatGPT or Claude generated, a snippet from a tutorial, a tracking or cookie-banner script a supplier sent over, the JavaScript at the bottom of a one-page site. You do not need a build step or a terminal to compress JavaScript for a page like that - paste it in, take the smaller version, paste it back into your <script> tag. It is also a quick way to answer "how much of this file is actually comments and indentation?" before deciding whether the minifying is worth it.

How It Works

The minifier is downloaded to your browser the first time you press Minify and then runs there. Your code is parsed as text and is never executed, evaluated or sent anywhere; the tool has no server side at all until you choose to publish. Two sets of numbers are reported: raw UTF-8 bytes, which is what the 5 MB instant-publish limit counts, and gzipped bytes, which is what a browser really downloads from any host that compresses its responses. On anything but a tiny snippet the gzipped figure is the smaller and more honest one, and it is why a 45% raw saving often turns into a 30% real one.

Limits

Terser is a minifier, not a transpiler. The output syntax setting limits which shortcuts it uses when printing; it will not turn modern class or arrow syntax into ES5 for an old browser. It also cannot bundle files, remove code that only your framework knows is unused, or fix a script that was already broken - a syntax error is reported with its line number and the previous output stays on screen. If a library reads function names at runtime, turn on Keep function names; if anything behaves oddly after minifying, turn on Safe mode, which switches off the compressor steps that can change behaviour in edge cases. To go the other way, the JavaScript Formatter turns a minified file back into readable code, and the HTML Minifier does the equivalent job for the page around it.

Then Put It Online

A script on its own is not a web page, so Publish builds a small page that presents the minified code and the bytes saved - handy for sending to a client or a colleague - and puts it on a live OxyPages link with HTTPS in seconds, with no account. The published page shows the code as text and does not run it. The link lasts 30 minutes unless you claim it, and claiming is free; from there you can pick your own address and, on a paid plan, connect a custom domain. To ship the script for real, paste it into a <script> tag in your page or upload the .min.js file alongside your HTML in a ZIP. See how it works for the full picture.

Questions

Frequently Asked Questions

Yes. The minifier runs in your browser and your code never leaves your computer unless you press Publish. It is only parsed as text: the tool never runs, evaluates or uploads what you paste.

Try It Now

Still Here? Drop It In.

The whole pitch fits in one sentence: your HTML, on a link, in seconds.

Drag and drop your HTML file(s), folders, or ZIP file

or ·

No account needed. Your unclaimed website stays live for 30 minutes on a free subdomain. Claim it to your account to keep it permanently.

  • No Account Needed
  • Free SSL
  • 30-Minute Unclaimed Link, Claim To Keep It