Get a reliable result in three steps
- 1
Paste or load reviewable JavaScript that uses explicit statement terminators.
- 2
Select Minify JavaScript to remove comments and conservative whitespace without running the code.
- 3
Review and test the compacted result in your own development workflow before deployment.
What this tool does
JavaScript Whitespace Minifier removes comments and conservative whitespace from JavaScript without executing the source or renaming identifiers. It is separate from the CSS Minifier and is intended for reviewable, semicolon-terminated code.
The result is produced only after the input is checked. If the value cannot be processed, the workspace reports a specific error instead of guessing.
Features
- JavaScript-only compaction
- Line and block comment removal
- Quoted string and template preservation
- No source execution
- Copy and download compacted JavaScript
Input and output
- Input
- JavaScript
- Output
- conservatively compacted JavaScript text
- Processing
- Local browser
Example
// Prepare a visible status message
const message = "Hello world";
const ready = true;
if (ready) { console.log(message); }Limitations
- Review important output before using it in production.
- Very large inputs remain subject to browser memory limits.
- This conservative text minifier does not parse the full JavaScript grammar, rename variables, fold expressions, build a source map, or perform compiler optimizations.
- Use explicit semicolons and review regular-expression literals and automatic-semicolon-insertion-sensitive code; a production compiler or bundler is safer for complex applications.