SQL formatting
Paste, drop, or import a SQL query into the input pane. The formatter rewrites spacing, indentation, line breaks, and keyword casing for the selected dialect.
The formatted output includes line numbers and SQL-specific highlighting. Keywords, data types, function calls, strings, comments, numbers, and quoted identifiers are colored separately so a long query is easier to scan before copying it into a database client.
Dialect and casing
SQL dialects differ in their functions, quoting rules, return clauses, and data types. Switch the Dialect control to match the target database before formatting. A PostgreSQL query with RETURNING, a BigQuery query with backtick identifiers, and a MySQL script with dialect-specific functions should be formatted under the matching mode.
Keyword Case controls only reserved words and SQL commands. Choose uppercase for team conventions like SELECT and WHERE, lowercase for codebases that prefer quieter SQL, or preserve when you only want spacing and indentation changed.
Indentation and statement batches
Indentation can be set to 2 spaces, 4 spaces, or tabs. Multiple statements are separated with blank lines after formatting, which is useful when cleaning up migration scripts, copied log queries, or database dump snippets.
The stats row reports the selected dialect, statement count, line counts, and byte sizes for the input and formatted output.
File export
Import accepts .sql and plain text files. After formatting, copy the highlighted result from the output pane or download a standalone formatted.sql file.