SQL formatter
FormattingPretty-print SQL for MySQL, Postgres, SQLite, BigQuery, Snowflake, and more.
What this tool helps with
SQL that comes out of an ORM, a code review diff, or a log line is often a single dense line that's hard to read. This formatter parses the statement and reflows it with consistent indentation and keyword casing across the common dialects — PostgreSQL, MySQL, Microsoft SQL Server, BigQuery, SQLite — so you can scan a JOIN chain at a glance. It runs locally, so production queries that contain identifiers you'd rather not leak stay on your machine.
How to use SQL formatter
- Open the SQL formatter page and paste, type, or generate the sql input you want to work with.
- Pick the options you need so the tool can pretty-print SQL for MySQL, Postgres, SQLite, BigQuery, Snowflake, and more
- Copy the format result with one click and use it in your next step — terminal, editor, ticket, or anywhere else you need it.
Common uses
- Reach for SQL formatter when you need to pretty-print SQL for MySQL, Postgres, SQLite, BigQuery, Snowflake, and more during debugging, code review, or content preparation.
- Skip installing a desktop sql app — open this formatting utility on a shared machine, an iPad, or a colleague's laptop and it just works.
- Bookmark or share the page when you and your team keep coming back to the same sql, format, pretty, and mysql workflow.
FAQ
Does it change my query's behaviour?
No. Formatting only reshapes whitespace and keyword case. Identifiers, literals, comments, and execution semantics are untouched.
What if my dialect-specific syntax isn't recognised?
Pick the closest dialect from the options — choosing the right one lets the parser handle dialect-only keywords (TOP, LIMIT, ILIKE, MERGE) without flagging them as errors.
Why are my keywords getting uppercased?
Uppercase keywords is a configurable convention because it makes the structural words pop visually. Switch the casing option to leave them as written if you prefer lowercase keywords.