The quick answer

Paste JavaScript and get the minified result, with a live size counter showing input characters, output characters and percent saved. Comments, indentation and the spaces around punctuation go; identifiers and program structure stay untouched: no mangling, no renaming. A 65-character script with one comment minifies to 43 characters, 34% off. Everything runs in your browser, and your code never uploads.

What this page is for

A js minifier task is usually a one-script job: a utility file, a vendor snippet, a bookmarklet that needs to shed bytes. A Node build pipeline is overhead for that, and an upload-based minifier site is the wrong venue for proprietary code. This page covers the middle: paste the script, read the size counter, copy the result. No account, no upload, no project context.

The JavaScript Minifier workflow, start to finish

  1. Paste your script

    The input box starts empty. Paste the script straight from the file, and the output pane and the size counter re-render on every keystroke.

  2. Read the size counter

    The Size change card shows three live numbers: input characters, output characters, and percent saved. A comment-heavy script sheds the most; an already-minified one sheds nothing.

  3. Skim what changed

    Comments, indentation and blank lines are gone, while identifiers and structure are untouched. The worked example below proves the no-mangling guarantee with exact characters.

  4. Copy the result

    The Copy button puts the minified script on your clipboard, ready for the template, the bookmarklet or the ticket.

  5. Close the tab when done

    Nothing was uploaded and nothing is stored: the minification ran in your browser, and closing the tab erases the session.

What the minifier strips, and what it never touches

The pass is lexical, not a re-parse, and deliberately conservative. Removed: single-line // comments, block /* ... */ comments, blank lines and leading indentation, and the spaces that sit around punctuation and operators (= + - * / { } ; , : < > ( )). Never removed: variable and function names, statement order, and semicolons. Nothing is renamed, which is what makes the output safe for scripts you cannot re-test; aggressive mangling for a production bundle belongs in terser or esbuild, not here.

Savings track comment and whitespace density, and the counter shows your number live as you paste. The worked example below, one comment on one line, sheds 34%. A JSDoc-annotated function sheds 64%. An already-minified script such as function a(b){return b*2} sheds nothing at all: 25 characters in, 25 out. The counter tells you which case you are in the moment you paste.

A worked minification, character counted

Take function greet(name) { /* say hello */ return "Hello, " + name; } at 65 characters with its comment. The minifier returns function greet(name){return"Hello,"+name;} at 43 characters, 34% saved: the comment, the indentation and the spaces around punctuation are gone, and the function name and argument survive verbatim. One detail in that output deserves attention: the space inside the string "Hello, " is gone too. The pass is lexical and does not know a string literal from code, so a space inside a string next to punctuation is removed with all the others, which is why this example's return value shifts by exactly one space.

One comment, one line of code

Input

function greet(name) { /* say hello */ return "Hello, " + name; }

Output

function greet(name){return"Hello,"+name;}
The JSDoc-heavy script, before and after

Input

/**
 * Converts a price to a display string.
 * @param {number} price - the raw price
 * @returns {string} formatted price
 */
function formatPrice(price) {
  // apply rounding to two decimals
  const rounded = Math.round(price * 100) / 100;
  return "$" + rounded.toFixed(2);
}

Output

function formatPrice(price){const rounded=Math.round(price*100)/100;return "$"+rounded.toFixed(2);}

The second sample is the shape where a comment stripper pays best: 278 characters in, 99 out, 64% smaller, with the whole saving coming from the JSDoc block, the inline comment and the indentation. Every number on this page came from running the engine on these exact inputs.

Who minifies JavaScript, day to day

Three jobs where this tool earns its bookmark:

Frontend developers trim a utility script before inlining it in a page. The no-mangling guarantee means the minified file behaves the same way, and every function name the page calls is still there to search for.

Release managers compress a tracking snippet a vendor sent before it goes into a template head. Paste it, copy the size numbers into the ticket, done; the vendor's code never crosses a network boundary in the process.

Sysadmins squeeze a bookmarklet or userscript under a size limit without standing up a build chain. The browser tab is the whole toolchain, and it works on a locked-down machine.

Features, plainly listed

What the js minifier promises, in one table:

AspectThis tool
Processing100% client-side (JavaScript in your browser)
Signup requiredNo; no account, no email
Data uploadedNever; the input stays on your device by architecture
SpeedInstant, live recomputation on every keystroke
Mobile supportFull; touch-sized inputs, responsive layout
Offline useWorks after first load; the minifier needs no network
CostFree, funded by clearly-labelled advertising away from controls
DocumentationFull methodology, worked examples and FAQ on this page

Every row is live and testable on this page right now.

When to double-check the result yourself

The minifier is exact about what it removes, and three edges are worth knowing before they surprise you:

  • Spaces inside string literals next to punctuation are removed like any other space: "Hello, " comes out as "Hello,". If a string's exact bytes matter, display text especially, diff the output against the input before shipping it.
  • Line breaks collapse where they sit next to punctuation: the ten-line JSDoc sample above returns as a single line, while a break between two bare identifiers survives. Paste ASI-sensitive code through a syntax checker before trusting any minifier's output, this one included.
  • Already-minified input stays the same size: function a(b){return b*2} goes in at 25 characters and comes out at 25, and the counter reads 0% the moment you paste it.

Your code never leaves the browser

The engine is plain JavaScript on the page: the minification happens between your paste and your clipboard, with no network request anywhere in the loop. The tool never uploads code to any compilation service, because there is no service to upload to, which matters for the proprietary bundles, vendor snippets and scripts with internal names that people actually paste into a minifier.

The competition, sized up

AlternativeWhere it winsWhere this tool wins
terser / esbuild in a build pipelineThe production answer: full mangling, dead-code elimination, source maps, repeatable buildsA ten-second pass with zero setup: right for one script, a vendor snippet, a machine without Node
prettier.io playgroundThe formatting standard, in a browserActually minifies, with a live before/after size counter, and never touches your identifiers
online minifier one-pagersInstant, familiar bookmarksDocuments exactly what is stripped (comments, indentation, spaces around punctuation), shows the method and its numbers, and states its sharp edges on the page

A real build pipeline still beats a browser tab for throughput and source maps, and the table does not hide it. A comparison that always wins is a comparison nobody should trust.

When the output looks wrong, check these first

Five minutes of method beats an hour of trial and error.

  • Bookmark the page. Repeat users save real time when the tool is one keystroke away, and the page loads instantly from cache on return visits.
  • Validate any tool with a known input before real code. The worked example above is the test: if 65 characters do not come back as 43, do not trust the tool with your script.

When something behaves unexpectedly, check these two first:

  • Output breaks after minifying: paste the script into a syntax checker first. The minifier preserves whatever you feed it, including a syntax error that was already there, and the string-literal space rule above can bite display text.
  • Sizes barely change: the script is already minified or comment-light. The no-mangling guarantee means no deeper compression is on offer here, by design.

If something still does not behave, the contact page reaches the engineers directly.

Frequently asked questions

These are the questions people actually search about the js minifier, answered directly. If yours is missing, the contact page takes feature and question requests.

Does JavaScript Minifier round or approximate its output?

No. The output pane shows the full minified text, and the size counter's character counts are exact: the worked example's 65 → 43 characters is what the engine produced on that exact input. The only rounding on the page is the percent-saved figure, which rounds to a whole number, so 33.85% displays as 34%.

Does the JavaScript Minifier work on mobile?

Yes. Open the page on iOS or Android and the tool behaves the same: responsive layout, touch-sized inputs, live results. The minifier is a web page, so there is nothing to install and nothing to update.

Do you store what I enter into the JavaScript Minifier?

No. The minification runs as JavaScript in your tab, so your script is never sent anywhere and nothing is written to any server. The network inspector confirms it in about thirty seconds if you want proof rather than prose.

Does the JavaScript minifier mangle or rename anything?

No, deliberately. The engine strips comments and whitespace only, so every function and variable name survives verbatim; there is no rename table because nothing is renamed. Deep minification with renaming is a job for esbuild or terser inside a build pipeline, not for a browser tool.

Is the JavaScript Minifier free to use?

Yes, and free means free: no signup, no email gate, no usage meter. The tool runs entirely in your browser, so each extra use costs this site nothing and costs you nothing either. Minify as many scripts as the job requires.

Minifier tools that chain well with this one

These tools share the JavaScript Minifier's workflow most often; the internal links exist because people genuinely chain them.

  • CSS Minifier & Beautifier: the same conservative pass for stylesheets. Minify JS and CSS together when you are trimming a page's weight.
  • HTML Beautifier & Minifier: compress the markup that carries the script tag, or pretty-print a minified template back the other way.
  • SVG cleanup: icons and logos shed editor metadata and whitespace the same way, so images, styles and scripts can all lose weight from browser tabs.

Sources and further reading

Primary references for the JavaScript behaviors this page relies on:

Sources and further reading

We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.