๐Ÿ› ๏ธ Developer & Web

SQL Formatter

Turn a one-line query into readable, well-indented SQL.

  • Freeno limits, no watermark
  • 0sign-ups or accounts
  • Privateruns on your device
  • Any devicephone, tablet or PC

Readable SQL

Long queries from ORMs, logs and BI tools usually arrive on a single line. The formatter places each major clause โ€” SELECT, FROM, JOIN, WHERE, GROUP BY, ORDER BY โ€” on its own line, lists columns one per line, indents sub-queries and CASE expressions and makes keyword case consistent. Choosing the right dialect matters: it teaches the formatter about features like PostgreSQLโ€™s :: casts, MySQL backticks, T-SQL square brackets and BigQueryโ€™s backtick table names.

Tips

  • Several statements separated by semicolons are formatted one after another.
  • Formatting never changes what the query does โ€” only whitespace and keyword case.
  • Placeholders like ?, $1 and :name are kept.

Going the other way? The SQL Minifier squeezes a query onto one line.

Everything runs in your browser โ€” your code and data are never uploaded, so it is safe to paste private config files and API responses.

Frequently asked questions

Which databases are supported?

Standard SQL plus MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, Oracle, BigQuery, Snowflake, Redshift and Spark.

Does it validate my SQL?

It reports tokens it cannot parse, but it does not check tables or run the query.

Is my query sent to a server?

No โ€” formatting happens entirely in your browser.

Found it useful? Share the SQL Formatter:

Last updated 2026-11-21 ยท Built by Vinayak Agarwal ยท Part of Developer & Web (77 tools)