Minify JavaScript online without uploading your code
Use this free JavaScript minifier to compress JS, remove unnecessary whitespace and comments, shorten local names where safe, and reduce JavaScript file size. It works directly in your browser and is useful for quick production builds, snippets, legacy scripts and one-off optimization tasks.
Why use this JS compressor?
- Private browser-side processing: your source code stays on your device.
- Advanced compression options: control parsing, compression, mangling, comments and output behavior.
- Instant size statistics: see output bytes and the percentage saved after minification.
- Fast workflow: paste code, click Minify, or enable “As I type” for live JavaScript compression.
How to minify JavaScript
- Paste your JavaScript source into the input editor.
- Choose Options if you need custom compression, mangling or output settings.
- Click Minify and copy the compressed JavaScript from the output editor.
JavaScript minification and privacy
The minifier runs in the page itself. Your pasted code is not submitted to JSCompressor.com for processing. This makes the tool practical for private snippets and development work where you do not want to upload source code to a remote minification API.
JavaScript minifier FAQ
What is JavaScript minification?
JavaScript minification removes characters and rewrites code that are unnecessary for execution, such as extra whitespace and many comments, while preserving the program’s behavior. Compression can also shorten local identifiers and simplify expressions.
Is a JavaScript minifier the same as a JS compressor or uglifier?
These terms are commonly used for the same goal: making JavaScript smaller. “Minify JS”, “compress JavaScript” and “uglify JS” may use different optimization levels, but users usually mean producing a smaller production file.
Will minifying JavaScript make my website faster?
Smaller JavaScript files can reduce transfer size and download time. For best results, combine minification with HTTP compression such as Brotli or gzip, caching and sensible code splitting.
Can I preserve license comments?
Yes. The default output configuration keeps comments matching common license markers such as @license, @preserve and comments beginning with !. You can adjust this in Options.