§ 3.1Why the dialect matters
Databases disagree on syntax. MySQL quotes identifiers with backticks, PostgreSQL and standard SQL use double quotes, SQL Server uses square brackets. PostgreSQL has :: casts and $1 parameters; T-SQL has TOP and GO. Picking the right dialect lets the formatter recognize these instead of treating them as errors.
§ 3.2What formatting changes — and what it doesn’t
- It changes whitespace, line breaks and (optionally) keyword case.
- It never changes identifiers, string literals, numbers or the order of clauses, so the formatted query does exactly the same thing.
- Comments are kept.
§ 3.3A house style that reads well
SELECT
o.id,
c.name
FROM
orders o
JOIN customers c ON c.id = o.customer_id
WHERE
o.created_at >= '2026-01-01'One column per line makes diffs in code review show exactly which column changed. Uppercase keywords separate SQL from your table and column names at a glance.
Formatting engine: the open-source sql-formatter library (MIT license), served from this site.
§ 3.QQuestions
Does formatting validate my SQL?
Only loosely. If the formatter can’t tokenize the query you get an error, but a query that formats cleanly can still fail on your database (unknown table, wrong types).
Is my query uploaded?
No. The formatter runs in your browser, which matters when queries contain table names or customer data.
§ 3.RReferences
Last reviewed 2026-10-14.