SQL Formatter
Format SQL with consistent indentation and keyword case, for eight dialects.
Formatted
Examples
Questions
Which SQL dialects are supported?
Standard SQL, MySQL, PostgreSQL, SQLite, MariaDB, SQL Server (T-SQL), BigQuery and Snowflake. Pick one from the menu. They quote names and strings differently, so the right one matters.
Does it change strings or comments?
No. The formatter reads each dialect's syntax, so text inside quotes and comments stays as it is, even the word SELECT.
What if I paste invalid SQL?
An unclosed quote or similar gives an error with its line and column. SQL that reads as tokens but doesn't make sense is still formatted as well as possible.
Does formatting change what my query does?
No. Only whitespace, line breaks and keyword casing change. Every value, name and operator stays exactly as it was.
Related tools
- JSON Formatter & ValidatorFormat, minify, check and repair JSON, with errors shown by line and column.
- JSON to CSV ConverterConvert a JSON array to CSV, or CSV to JSON, with nested keys as columns.
- Base ConverterBinary, octal, decimal and hex, all at once.
- HTTP Status Code LookupEvery HTTP status code, what it means and when to use it.
- String Escape / UnescapeEscape or unescape text for JavaScript, JSON, SQL, shell or CSV.