SQL formatter and beautifier
Beautify and indent SQL queries across major dialects. Runs entirely in your browser.
Runs 100% in your browserHow to format SQL
- Paste your SQL. Paste a query or script into the input.
- Pick your dialect. Select your database and keyword casing.
- Copy the result. Copy the formatted SQL.
About SQL formatting
Long queries pasted from logs or ORMs arrive as one dense line. Formatting them — consistent indentation, one clause per line, predictable keyword casing — makes them far easier to read, review and debug. Pick the dialect that matches your database so its specific keywords and operators are recognised. The formatting is purely cosmetic and never alters what the query does.
Frequently asked questions
- Standard SQL plus PostgreSQL, MySQL, MariaDB, SQLite, BigQuery, Snowflake, Transact-SQL and more — pick the one that matches your database so keywords and syntax are handled correctly.
- No. Formatting only adds line breaks, indentation and consistent keyword casing. The query logic is unchanged.
- Yes — named (
:id), numbered ($1) and?placeholders are preserved. - No. Formatting runs entirely in your browser; the query never leaves your device.