SQL Formatter
Beautify and minify SQL across PostgreSQL, MySQL, SQLite, BigQuery and more
Formatted SQL will appear here
Paste or type a SQL query above to begin
Advertisement
Format or minify SQL online with dialect-aware indentation and keyword casing. Supports Standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, and SQL Server.
Beautify and minify SQL across PostgreSQL, MySQL, SQLite, BigQuery and more
Formatted SQL will appear here
Paste or type a SQL query above to begin
Transform unformatted SQL into readable code with proper indentation and dialect-aware formatting. Switch between beautify and minify modes, choose keyword casing and indentation, and download .sql output. Supports Standard (ANSI) SQL, MySQL, PostgreSQL, SQLite, BigQuery, and SQL Server (T-SQL).
What you get with SQL Formatter.
Standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, and SQL Server.
Correct indentation for JOINs, subqueries, and CTEs.
Uppercase, lowercase, or leave keywords exactly as you wrote them.
Follow these steps to get the best results.
Paste a messy or minified query, uppercase or lowercase, single or multi-line.
Choose Standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, or SQL Server for dialect-aware formatting.
Choose 2-space, 4-space, or tab indentation, and uppercase, lowercase, or preserved keywords.
Copy the formatted query. Only whitespace and keyword casing change — logic and values stay untouched.
Advertisement
Common questions about SQL Formatter.
Never — only whitespace and letter casing are modified. Table names, column names, and values are left exactly as-is.
Advertisement
Comments
Share feedback, ask questions, or help others use this tool.
Join the discussion
Sign in to comment, reply, and report inappropriate content.