SQL Server (T-SQL) Formatter

Paste a SQL Server (T-SQL) query and get it laid out clause by clause — with Microsoft SQL Server and Azure SQL syntax handled correctly.

Input · drop a file

Output

SQL Server (T-SQL)-specific syntax this formatter understands

  • [Bracketed] identifiers and @variables are kept intact
  • TOP, WITH (NOLOCK) and OUTPUT are laid out correctly
  • GO batch separators and DECLARE/SET statements are handled
  • CROSS APPLY and OUTER APPLY are treated as joins

Formatting changes only whitespace and keyword case. What the query does is unchanged. Need another database? The main SQL formatter has 11 dialects, and the SQL minifier squeezes a query onto one line.

Questions

Is this SQL Server (T-SQL) formatter free and private?

Yes. It runs in your browser using the open-source sql-formatter library; your query is never uploaded.

Is this the same as Poor SQL or SSMS formatting?

It solves the same problem in your browser, with no install. Styles differ slightly; pick keyword case and indent to match your team’s convention.

Does it check my query against my schema?

No — it understands the syntax, not your tables. A nicely formatted query can still reference a column that doesn’t exist.

Related tools