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.
Switched to HTTPS

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

Formatting Options
spaces
Empty field means leave indentation unchanged.
Formatted by SQLFormat.org (https://sqlformat.org)
After you have formatted a SQL statement you'll see the formatted statement here, ready for printing.