Original size
292 B
Paste JavaScript to remove comments and unnecessary whitespace, then compare original size, minified size, savings, and syntax status.
Smaller JavaScript can help first load and cache efficiency. For production, still treat your project build and tests as the final check.
Syntax check
Syntax looks valid
Original size
292 B
Minified size
228 B
Bytes saved
64 B
Savings
21.9%
Gzip estimate
80 B
Lines removed
11
Paste JS code you want to shrink before deployment.
Review the minified result, copy it, or download a .min.js file.
function calculateTotal(items){const total=items.reduce((sum,item)=>{return sum+item.price*item.quantity;},0);console.log("total",total);return total;}const cart=[{price:12,quantity:2},{price:5,quantity:3}];calculateTotal(cart);This tool is for quick size reduction and review. Use your build pipeline for variable mangling, dead-code removal, and module bundling.
This tool runs in the browser and does not upload code. It preserves strings and template literals while removing ordinary comments and unnecessary spacing.
No. It is a quick browser minifier. It does not rename variables, tree-shake, or deeply optimize code.
No. Everything happens in the browser.
Keep the preserve option on to retain important comments that start with /*!.
Keep exploring
Jump into related tools from the same category and popular picks across Gogotem.
Format, validate, and minify JSON payloads in one place.
Encode plain text to Base64 or decode Base64 back into text.
Encode and decode query-safe URL values for links and APIs.
Convert Unix timestamps into readable dates and back again.
Generate SHA hash values from plain text input.
Generate one or more UUID v4 values for development and testing.