SQL Formatter
Pretty-print SQL
What is SQL Formatter?
Pretty-print SQL across six dialects: standard, PostgreSQL, MySQL, SQLite, BigQuery, and T-SQL. Keyword case is configurable (upper, lower, or preserved) and indent width is 2 or 4 spaces. Useful for cleaning up a long query for code review, making a generated query human-readable, or reformatting inherited SQL to your team's style.
How do I use SQL Formatter?
- Paste SQL into the input panel.
- Pick the dialect and keyword case.
- Copy the formatted output.
When should I use SQL Formatter?
SQL Formatter is for read-layer cleanup. To minify SQL (rare), remove comments and collapse whitespace in your editor. For validating that a query compiles, run it in your target database — formatters don't validate.
Which SQL dialects are supported?
ANSI, PostgreSQL, MySQL, SQLite, MS SQL, BigQuery, and Snowflake. Pick yours in the dialect dropdown — keyword recognition and reserved words differ.
Can it uppercase keywords?
Yes. Toggle "UPPERCASE KEYWORDS" for SELECT / FROM / WHERE style, or keep them as typed if you prefer lowercase house style.
Does it break long queries onto multiple lines?
Yes — SELECT clauses, JOINs, and WHERE predicates are wrapped consistently. Indent width is configurable (2, 4, or tab).
Is my file uploaded anywhere?
No. Everything runs in your browser. Your files never leave your device, and there is no server component for this tool.