SQLFormat is a free online formatter for SQL statements. Enter your SQL statement in the textarea below and click "Format SQL" [Ctrl+Enter]. To upload a file use the button right below the textarea.

In addition to this web interface SQLFormat provides an API. Or you can download the Python module that powers this service to use it in your own applications. See source code for details.

Accepted file types are plain text files and SQLite3 databases, maximal file size is 1 MB.
Sorry for the Outage!

This service was offline for about 3 days (Sunday, Dec. 18th - Thuesday, Dec. 20th). Sorry for that!
I've received a mail from the monitoring on sunday, but happily ignored it to do some serious season business (cookies). It seems that the outage was caused by one unattended update. And I promise to read my mails more carefully, even when doing other things.

Switched to HTTPS

Both the frontend and the API are now available via HTTPS. Please update your bookmarks.
More news...

Formatting Options
Empty field means leave indentation unchanged.
This software is in development.
What happens with donations?
Formatted by SQLFormat.org (https://sqlformat.org)
After you have formatted a SQL statement you'll see the formatted statement here, ready for printing.