JavaScript Minifier
Free online JavaScript minifier (JS minifier) to minify JS code instantly. Paste your code and compress it by removing whitespace, shortening variables, and optimizing expressions.
About this tool
This online JavaScript optimizer uses Terser to compress your code for production. It removes whitespace, comments, and dead code, shortens variable and function names, and simplifies expressions, all without changing how the code behaves. Smaller JavaScript bundles mean faster page loads, lower bandwidth costs, and better scores on Lighthouse and Core Web Vitals. Paste your source, click minify, and get production-ready output in seconds.
Use Cases
- Production DeploymentReduce JS bundle size before deploying to production for faster page loads and lower bandwidth usage.
- Build PipelineQuickly minify standalone scripts outside your build tool when you need a fast, one-off optimization.
- Lighthouse & Core Web VitalsSmaller JavaScript payloads directly improve Time to Interactive and Total Blocking Time scores.
How It Works
Paste Your JavaScript
Copy and paste your JavaScript source code into the editor.
Click Minify
Press the Minify JavaScript button and Terser will compress the code instantly.
Copy the Result
Copy the minified output or start over with new code.
Questions & Answers
No. All minification is done entirely in your browser using Terser. Your code never leaves your device.
No. Terser only removes whitespace, comments, and redundant syntax, and renames variables internally. The minified code is functionally identical to the original.
If the code cannot be parsed, the tool will display an error message so you can identify and fix the issue before minifying.