JavaScript formatter
Free online JS minifier and formatter. Format and compress JavaScript code with customizable indentation.
Indent
How it works
Paste JavaScript code, click 'Format' to indent with readable structure or 'Minify' to compress by removing comments, spaces and empty lines while maintaining functionality.
FAQ
Can minification break the code?
In rare cases with code that depends on specific whitespace. For standard JavaScript the minification is safe and doesn't alter behavior.
Is it better than Terser or UglifyJS?
This tool offers basic minification (removing spaces and comments). For production with advanced obfuscation and tree-shaking, use Terser in your build system.
Does the formatter preserve comments?
In formatting, comments are removed for cleanliness. In the original version of the code they are preserved until minification.