Format SQL
Format SQL using the selected dialect.
Input & settings
How to use this tool
Paste a SQL statement, select any supported formatting options, and inspect the result. Copy it into your own database editor only after confirming the dialect and actual operation.
Limits and behavior
This is a formatter, not a database syntax validator. No SQL is executed. Maximum total input 1 MB, output 3 MB, JSON nesting 64 levels. Processing stays in your browser worker. Input is limited to 1 MB and output to 3 MB. No input content is saved by CraftAI.
Beautify a SQL query
Format SQL statements into readable lines and indentation while respecting supported dialect syntax.
Is SQL formatting the same as validating a database query?
No. This does not connect to a database or confirm that referenced tables and columns exist.
Related tools: · format json
Separate SQL readability from correctness
The statement SELECT id,name FROM customers WHERE active=1 can be reformatted to make the column list and WHERE condition easier to review.
Important: Formatting does not execute SQL or ensure compatibility with your database. In particular, SQL dialects differ in quoting, operators and reserved words.