SQL

SQL formatter

Turn one-line queries from logs and ORMs into readable SQL. Pick your dialect, format, and read the query the way it was meant to be read.

query.sqlDetected: SQL ✓
select u.name,count(*) as orders from users u join orders o on o.user_id=u.id where u.active=true group by u.id,u.name having count(*)>5 order by orders desc
output.sql
SELECT  u.name,  count(*) AS ordersFROM  users u  JOIN orders o ON o.user_id = u.idWHERE  u.active = TRUEGROUP BY  u.id,  u.nameHAVING  count(*) > 5ORDER BY  orders DESC
✓ Formatted locally · never executed

Dialect-aware formatting

Choose Generic, PostgreSQL, MySQL, SQL Server, Oracle or SQLite. Dialect matters for quoting, operators and keywords, so formatting follows the rules of the database you actually use. Keywords are uppercased (note true becoming TRUE above) and each clause starts on its own line.

Read the query, not the line

Generated SQL often arrives as one long line. Formatted, a query reads top-down, with each join and condition on its own row, so mistakes in a JOIN … ON or a HAVING are easy to see. Minify is available when you need the compact form back.

Pasted SQL is never run

DocuFormat parses and prints SQL text. It does not connect to a database and never executes what you paste, so it is safe for queries that contain DELETE or DROP.

Structural checks, not a full SQL parser

Local checks catch problems such as unbalanced parentheses, unterminated strings and comments, and statements that end right after a clause keyword. It is not a full parse for every dialect, so a query can pass these checks and still be rejected by your database. When a query is clearly wrong, see the SQL fixer.

Questions, answered

Does it run my query?

No. SQL is only parsed and formatted as text. It is never executed and there is no database connection.

Which SQL dialects are supported?

Generic, PostgreSQL, MySQL, SQL Server, Oracle and SQLite.

Can AI explain a query?

Yes. Click Explain to get a step-by-step description of what the query does. It is only sent after you click, and the query is never run.

Will it validate my query against my schema?

No. It has no access to your database or schema.

Try the SQL formatter on your own input.

Paste it, format it, and fix it if it is broken, once DocuFormat opens.