SQL Formatter

A T-SQL formatter that formats statements carrying comments instead of skipping them, and hands back exactly what you pasted, with a reason, rather than guessing when it cannot.

Formatted
Formatted SQL appears here.

It formats statements that carry comments, which most formatters skip, and keeps each comment with its code.

It only moves whitespace. If anything else would change, you get your SQL back with the reason. The layout follows the SQL Server docs: keywords at the margin, four-space indents, trailing commas.

Private by design: everything runs in your browser. The SQL you paste is never uploaded, logged, or stored anywhere.