How to use
- Paste your SQL. It is formatted as you type.
- Choose the dialect, keyword case and indentation.
- Click Format to replace the input, or copy and download the result.
Format SQL for MySQL, PostgreSQL, SQLite and more
Long queries generated by ORMs or copied from logs are painful to read on one line. The formatter understands the grammar of each dialect and places clauses, joins, conditions and subqueries on their own indented lines, with consistent keyword casing. Use One line mode to collapse a formatted query back for logging or embedding in code.
Standard SQL, MySQL, MariaDB, PostgreSQL, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift, Spark SQL, Hive, Trino/Presto, IBM DB2, Couchbase N1QL and SingleStore. Pick the dialect so vendor-specific keywords and operators are recognized.