SQL formatter and dialect converter
Format a SELECT query with one column per line and clauses broken out, or convert quoting and LIMIT syntax between MySQL and Postgres.
Basic formatter for everyday SELECT queries — complex nested SQL may need manual cleanup. Conversion swaps backtick and double-quote identifiers and rewrites LIMIT offset forms; it does not convert functions or data types.
About this tool
SQL rarely arrives readable. Queries copied out of application logs, ORM debug output, slow-query reports, and old codebases tend to show up as a single dense line where the columns, the join conditions, and the filters blur together. SQL Tools gives that query a consistent shape: keywords are uppercased, each top-level SELECT column gets its own indented line, and FROM, WHERE, GROUP BY, ORDER BY, HAVING, and LIMIT each start on a fresh line, with joins broken out the same way. The result is a query you can scan in seconds — which columns, from which tables, filtered how, sorted by what. The converter handles the two differences that bite most often when a query moves between MySQL and Postgres: identifier quoting, where MySQL's backticks become Postgres double quotes and back again, and the LIMIT forms, where MySQL's LIMIT offset, count becomes LIMIT count OFFSET offset in Postgres syntax and reverses cleanly. This is a basic formatter for everyday SELECT queries, built to be predictable rather than clever: it does not rewrite your logic, evaluate your query, or connect to any database, and everything happens locally in your browser.
Frequently asked questions
Which SQL statements does the formatter handle?
It is designed for common SELECT statements: column lists, joins (including LEFT and INNER JOIN), WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, and OFFSET. Basic formatter for everyday SELECT queries — complex nested SQL may need manual cleanup.
What exactly does the dialect converter change?
For queries, it swaps identifier quoting between MySQL backticks and Postgres double quotes, and rewrites LIMIT a, b as LIMIT b OFFSET a (and back). It does not convert functions, data types, or DDL statements such as CREATE TABLE.
Will formatting change what my query does?
Formatting only changes whitespace and keyword casing, which SQL ignores. The converter changes quoting style and LIMIT arrangement between equivalent dialect forms. Always re-check a converted query before running it against production data.
Does the tool connect to my database?
No. There is no database connection and nothing is executed or uploaded. The query text is processed entirely in your browser, so it is safe to paste queries that mention internal table and column names.
Why did my column list not split the way I expected?
Columns are split only on commas at the top level — commas inside parentheses, such as function arguments, are left alone. A subquery in the column list counts as one item, which is usually what you want when scanning the shape of a query.