SQL Formatter
Online
sql-formatter
Paste a SQL query to format
SQL
Ctrl+↵ format
Was this tool helpful?
Related Tools
Frequently Asked Questions
SQL formatting automatically adds indentation, line breaks, and keyword alignment to SQL queries. This makes queries easier to read, analyze, and debug.
Readable SQL is easier to maintain and review for errors. Formatting is especially helpful when working with long queries containing subqueries, joins, and complex conditions.
Standard SQL, MySQL, PostgreSQL, SQLite, T-SQL (Microsoft SQL Server), and PL/SQL (Oracle) are supported. The tool can automatically detect the dialect from query keywords.
Each keyword (SELECT, FROM, WHERE, JOIN) starts on a new line, nested blocks are indented, and long column lists are split line by line. This lets you quickly understand the query structure.