← Back to tool

T-SQL · Brackets · Indent

SQL Server & T-SQL Formatter

Updated: June 2026

SQL Server speaks T-SQL, with square-bracket identifiers, SELECT TOP, and its own function set. This formatter understands those conventions and lays your queries out cleanly without breaking the brackets.

Format My T-SQL →

Free · No upload · Instant in the browser

Made for T-SQL

Microsoft SQL Server uses Transact-SQL, which diverges from other dialects in a few visible ways. The signature one is square-bracket quoting: T-SQL wraps identifiers in [ and ] so names like [Order Details] or reserved words can be used as table and column names. A formatter that does not understand brackets will mangle them; this one treats a bracketed name as one indivisible token.

It also handles the TOP clause that T-SQL uses instead of LIMIT, keeping SELECT TOP 10 together on the same line, and it recognises T-SQL functions and the ISNULL / CONVERT style helpers common in SQL Server code.

A SQL Server example

select top 10 [Customer].[Name],count(*) as Orders from [Customer] join [Order] on [Order].CustomerId=[Customer].Id where [Customer].Active=1 group by [Customer].[Name] order by Orders desc;

formats to:

SELECT TOP 10
  [Customer].[Name],
  count(*) AS Orders
FROM
  [Customer]
  JOIN [Order]
  ON [Order].CustomerId = [Customer].Id
WHERE
  [Customer].Active = 1
GROUP BY
  [Customer].[Name]
ORDER BY
  Orders DESC;

The bracketed names are preserved exactly, TOP 10 rides along with SELECT, and the rest of the query breaks into clean, reviewable clauses.

Readable stored procedures

Much of the SQL in a SQL Server shop lives inside stored procedures and views, where queries are read far more often than they are written. Formatting those bodies makes maintenance dramatically easier: a procedure with a dozen joins becomes navigable when each join sits on its own line beside its condition. Uppercase keywords add another layer of clarity, separating the T-SQL machinery from your schema names at a glance.

No upload, no exposure

SQL Server queries frequently sit close to sensitive enterprise data, so pasting them into an online service that processes them on a remote server is a real risk. This formatter avoids that entirely by doing every bit of parsing in your browser. Your T-SQL never crosses the network, nothing is logged on a server, and the tool keeps working if you disconnect — so you can clean up even the most confidential procedure safely.

Frequently asked questions

Does it handle [bracketed] identifiers?

Yes. SQL Server's square-bracket identifiers like [Order Details] are treated as single tokens, so names with spaces or reserved words survive formatting unchanged.

Does it support SELECT TOP?

Yes. The TOP clause and its count stay on the SELECT line, so SELECT TOP 10 formats naturally rather than being split awkwardly.

Is it free and private?

Yes. The T-SQL formatter is free, needs no account, and runs entirely in your browser, so your SQL Server queries are never uploaded.