JavaScript压缩器
在浏览器中处理或呈现JavaScript压缩。
Up to 500,000 characters. Processing stays in this browser.
使用步骤
如何使用
- Paste JavaScript into the editor or load the sample.
- Choose whether comments and final semicolons should be removed, then inspect the size change.
- Copy the minified script or download it as a JavaScript file.
Conservative browser-side minification
This tool removes comments outside strings and template literals, collapses safe whitespace, and optionally removes semicolons before closing braces. Your code stays on this device and is never sent to a server.
Keep a readable source file
The result is intended for quick local use. Keep formatted source and source maps in your project, and use a tested JavaScript build pipeline for production code, transpilation, bundling, and advanced syntax.
常见问题
你可能还想知道
Does this rewrite or optimize my JavaScript?
No. It performs a focused text transformation and does not rename variables, reorder code, transpile syntax, or run a JavaScript parser.
Are strings and template literals preserved?
Yes. Text inside single-quoted, double-quoted, and template literal strings is kept, including escaped characters and interpolation expressions.
Is my code uploaded?
No. Minification, copying, and download preparation happen locally in your browser.
Can I use this for production builds?
Use a tested build tool for production. This page is useful for a quick compact copy and does not generate source maps.