SQL Formatter
Format nested SQL statements with customized spacing, capitalized keyword queries, list indentations, and standard clause line separations in the browser.
How to Format SQL Queries Across Dialects
- Select your target database dialect (PostgreSQL, MySQL, SQL Server, BigQuery, Standard SQL, or SQLite).
- Paste unformatted or nested SQL queries into the raw query editor or load a dialect-specific sample.
- Configure indentation (2 spaces, 4 spaces, tab), keyword casing, type/function casing, and AND/OR clause alignment.
- Download the formatted
.sqlscript or copy it directly to your clipboard.
Key Features
- Dialect-Aware Parser: Native formatting rules for PostgreSQL ($1, ::type), MySQL (
backticks, @vars), SQL Server ([brackets], TOP, WITH NOLOCK), Google BigQuery (project.dataset.table, STRUCT, ARRAY_AGG), ANSI SQL, and SQLite. - Keyword & Type Casing: Flexible upper/lower/preserve toggles for reserved keywords, data types, and built-in functions.
- Clause Alignment: Configurable newline placement for logical operators (
AND/OR). - Interactive Dialect Samples: One-click sample loader for testing authentic dialect syntaxes.
- Comparison Matrix: Embedded engine reference table highlighting quote styles, parameter formats, and pagination rules.
Frequently Asked Questions
Which database dialects are supported?
The formatter supports PostgreSQL, MySQL, SQL Server (T-SQL), Google BigQuery, Standard ANSI SQL, and SQLite dialects.
Are my database queries secure?
Yes, 100% private. All formatting and parsing happens entirely client-side inside your browser sandbox. No query parameters or schema names ever leave your device.
Where can I learn more about SQL formatting standards?
For best practices on CTE organization, keyword capitalization, and join readability, read our guide on Modern SQL Formatting Standards.
