JavaScript Formatter and Minifier
Format JavaScript for readable inspection or create a compact version for testing and transport. Processing takes place locally in your browser.
Start using
JavaScript Formatter and Minifier
Format JavaScript for readable inspection or create a compact version for testing and transport.
Formatting uses syntax parsers in a cancellable background worker and does not execute pasted code. Quoted text is preserved. Maximum input: 500000 characters; maximum output: 4000000 characters. Processing stops after 5 seconds; excessive nesting and unsupported syntax produce an error. Review and test the result before using it.
Paste JavaScript, choose 2 spaces, 4 spaces or Tab and select beautify or minify in Output mode. Press Format JavaScript, inspect the result, then Copy all. Both modes preserve comments and variable names; minify only compacts code. Clear cancels pending work and clears the input and result; mode and indentation remain selected.
function add(a,b){return a+b}function add(a, b) {
return a + b;
}Processing takes place locally in your browser.