SQL formatter

Turn long one-line SQL into neatly indented queries, for PostgreSQL, MySQL, SQL Server, Oracle, BigQuery and more. Your queries never leave this tab.

Runs in your browser. Your files are never uploaded or stored.

Something not working, or missing an option?

How to use SQL formatter

  1. Paste a query or open a .sql file.
  2. Choose your database and how keywords should look.
  3. Select Format SQL, then copy or download it.

Questions

Does it change what my query does?

No. Only spaces, line breaks and, if you choose, the letter case of keywords change.

Are my files uploaded?

No. The tool runs inside your browser, and the page is blocked from sending data anywhere. You can check by turning off your internet connection: it keeps working.

Open-source parts

Full license texts