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.
This tool is often used to format SQL statements for debugging. So it seems to be a good choice to enforce a secure connection when communicating with this service. All requests to HTTP urls will be redirected to the according HTTPS urls.
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.