Compact JavaScript conservatively without deleting comments, line boundaries or content inside strings.
Result will appear here...
function test() {
console.log("Hello");
}
Output:
function test() {
console.log("Hello");
}
This browser tool removes blank lines and trailing whitespace while preserving comments and JavaScript line boundaries. That is deliberately more conservative than a parser-backed production minifier, because deleting comments or joining lines with regular expressions can corrupt URLs, regular-expression literals, template strings and automatic semicolon insertion.
Use a parser-backed build tool such as Terser for production bundles. Use this tool for quick, low-risk cleanup when preserving behavior matters more than maximum compression.