Overview
SQLFormat is an online formatter for SQL statements. Paste a query that arrived as one long line, press Format (or Ctrl+Enter), and it comes back indented with each clause on its own line, which makes long joins and nested subqueries far easier to read and review.
Options cover the case of keywords and identifiers (unchanged, lower, upper or capitalised), indentation, comment removal and a compact mode. The result can be shown as plain SQL or wrapped as a Python or PHP string for pasting into code, and you can load a file instead of pasting. Formatting is done by the open-source sqlparse Python library, which the site runs inside your browser through Pyodide; the site says statements are handled in the browser without being sent to its server.
There is also a small web API with endpoints for formatting and for splitting a string into separate statements. It needs no key and is limited per IP address per hour. Those requests do go to the server. The site is run by phasenpunkt, a German company connected to sqlparse, and is supported by advertising, merchandise and donations.
Categories
Features
- Reindents SQL with one clause per line
- Keyword and identifier case conversion
- Option to strip comments
- Compact output mode
- Output as SQL or as a Python or PHP string
- File upload as well as paste
- Formatting runs in the browser using sqlparse
- Free web API for formatting and splitting statements
Privacy
The site says SQL entered on the page is handled in your browser without being sent to its server; requests to the API are sent to the server. The page loads Google AdSense and Google Tag Manager scripts.
Pros & Cons
Pros
- Free, with no account
- The site says queries are formatted in the browser and not sent to its server
- Built on a widely used open-source parser
- The API needs no key
Cons
- Shows Google ads
- Generic formatting with no dialect-specific settings on the page
- API requests are processed on the server and limited per hour
- Does not check that a query is valid
Community Reviews (0)
No written reviews yet — be the first to rate this tool.
Similar Tools
-
SQL Tools · SQL Pretty Printer
Formats SQL for readability.
Free No Signup Web