Developer

JavaScript Formatter

Beautify and tidy JavaScript code.

This free JavaScript formatter runs your code through the Prettier engine for clean, standards-compliant output — consistent indentation, line breaks, quote style and spacing that goes beyond a simple re-indenter. Choose 2-space, 4-space or tab indentation, set a wrap width, switch between single and double quotes, and toggle semicolons. A Minify option strips comments and extra whitespace to shrink file size while preserving strings, template literals and regular expressions. If Prettier can't parse a partial or invalid snippet, the formatter falls back to a brace-depth re-indenter so you still get readable output.

Related tools