JavaScript Minifier
Enter JavaScript code in the textbox and click the button to minify it.
Keywords to Conserve (with spaces as needed):
Classes with Methods to Conserve:
Disable Minification:
Preserve Whitespace:
Code to Minify:
// This is a test! function add(addend0, addend1) { var result = addend0 + addend1; return result; } function multiply(factors) { var productSoFar = 1; for (var i = 0; i < factors.length; i++) { var factor = factors[i]; productSoFar *= factor; } return productSoFar; } function cube(base) { return Math.pow(base, 3); } var addend0 = 1; // test comment var addend1 = 2; var sum = add(addend0, addend1); alert("The sum of " + addend0 + " and " + addend1 + " is " + sum); var factors = [1, 2, 3, 4]; var product = multiply(factors); alert("The product of " + factors.join(", ") + " is " + sum); var base = 3; var cubeOfBase = cube(base); alert("The cube of " + base + " is " + cubeOfBase);
Minify
Code after Minification: