Remove comments and collapse whitespace to shrink JS files. Optionally strip console.log calls before shipping to production.
// … comments while being careful not to touch URLs inside strings/* … */, optionally preserving /*! … */ license headersconsole.* — optionally strips console.log(), console.warn(), etc. for production builds;, {, } and indents blocks for human readability. Useful for reading minified third-party code.Note: This tool does not rename variables, inline constants, or perform dead-code elimination. For production use, consider build-time tools like esbuild, Terser, or Rollup which do full AST-based optimisation. This tool is great for quick minification of small scripts or making minified code readable.
[, (, /, +, or - where a semicolon is implicitly needed), it will work identically. If you're unsure, test the output in your browser's console before deploying. For complex codebases, use Terser or esbuild which have test suites specifically covering these edge cases.console.log(incrementCounter()) would be unsafe to remove if incrementCounter() has side effects beyond logging. In practice, most console.log calls just pass simple variables or string literals and are safe to strip. The "Remove console.*" option here uses a simple regex and removes the entire statement — it doesn't parse the arguments. If you're unsure, leave this unchecked and handle it at build time with a linter rule or Terser's drop_console option.