Website Tools
JavaScript Minifier
Instantly compact JavaScript by removing unnecessary whitespace, right in your browser.
Paste your JavaScript below to instantly compact it - entirely in your browser, nothing is sent to our servers.
This safely compacts whitespace and blank lines. It does not strip comments, since doing that safely requires fully parsing your code - and getting it wrong could break strings or regular expressions that contain comment-like characters.
JustChecker builds tools that respect your data - this one never leaves your browser.
Frequently Asked Questions
No - this tool runs entirely in your browser using JavaScript. Nothing you paste is transmitted anywhere.
No, deliberately - safely stripping comments requires fully parsing your code to distinguish real comments from "//" or "/* */" sequences that happen to appear inside strings or regular expressions. Getting this wrong could silently corrupt your code, so this tool only performs safe whitespace compaction.
A proper build-time minifier like Terser or esbuild, which fully parses your code into an AST before transforming it, is the safe way to do more aggressive minification.