JavaScript Minify
Type or paste into the Code textarea. The result updates live by deleting block comments and squeezing runs of whitespace into single spaces, then trimming the ends—handy for quick size checks before a proper bundler.
Updated 2026-08-03 · developer
About this tool
This page is a lightweight client-side compressor, not a full AST minifier. It strips /* ... */ comments and replaces any whitespace sequence with one space. There is no separate button; the compacted string always shows in the result area under the Code box.
How to use
- Paste your code: Put JavaScript (or similar source) into the Code textarea.
- Read the live result: Watch the result area; it updates as you type without clicking a button.
- Check comments and spaces: Confirm block comments are gone and extra newlines or tabs became single spaces.
- Copy the compacted text: Select the result text and paste it where you need the smaller snippet.
Common use cases
- Shrink a short script snippet before pasting into a bookmarklet or inline tag.
- Compare character count before and after removing comments and blank lines.
- Clean sample code that still has block comments when you only need the logic.
Tips
- Prefer /* */ comments; // line comments are not stripped by this pass.
- Strings that contain comment-like text may be altered—review output before shipping.
FAQ
Does minification require a button click?
No. The compacted output recalculates whenever the Code field changes.
Are // comments removed?
No. Only /* */ block comments are stripped; // lines stay in the text.
Is this a full production minifier?
No. It only collapses whitespace and block comments—it does not rename variables or parse an AST.
Does my code leave the browser?
No. Compression runs entirely on the textarea content in the page.