JS Minify & Format

Remove comments and whitespace from JavaScript to reduce size (minify), or tidy up indentation (format). It recognizes strings and regular expressions to process safely, and your code is never sent to a server.

This is a safe minify that works without any library. It does not do advanced optimizations like renaming; it only removes comments, indentation, and unnecessary whitespace while keeping line breaks so behavior does not change.

Input JS
Result

How to use

Minify removes comments, indentation, blank lines, and unnecessary whitespace. Because line breaks are kept, automatic semicolon insertion (ASI) won't change behavior.

Format re-indents lines based on bracket depth to make them easy to read.

All processing happens in your browser, and the code you enter is never sent anywhere.