JavaScript Minifier
Minify JavaScript with terser: shorter code, an optional source map and a before and after size including gzip. Private, in your browser.
JavaScript
Stays in your browserResult
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Next steps
Done here? Use the Send to… menu on the result to carry it on to JavaScript Beautifier or HTML Minifier.
Free Online JavaScript Minifier
Make a JavaScript file smaller for production. Paste your code, press Minify and copy or download the result with the size you saved. It gives developers a quick browser-based way to solve a focused javascript minifier task before moving the result into a project.
How to use the javascript minifier
Paste your code in the box, adjust the options if you want, and press Minify. Mangling shortens variable and function names, compressing rewrites code into smaller equivalent forms, and a source map lets browser tools show your original code. Everything runs in your browser.
Common mistakes
- Keep the original file: minified code is not meant to be edited or read.
- Test the result before you ship it, especially if the code relies on function names or comments.
- Minify modules and scripts separately: the tool treats the text as one script.