SQL Formatter
The SQL formatter breaks a long query onto separate lines at the major clauses, indents subqueries and joins, and normalises keyword case. It is designed for reading generated or minified SQL from a log rather than for rewriting a query.
Your result will appear here.
Not sure where to start? Use Load example.
Results update automatically and are calculated on your device. Nothing you type is sent to a server.
Runs in your browser. Processing happens entirely in your browser. Nothing you enter is sent to Delimiter.live.
How to use the SQL Formatter
- Paste the query, including one copied straight out of a slow-query log.
- Choose whether keywords should be uppercased.
- Read the indented result, then copy it into your editor.
Example
select * from users where id = 1
SELECT * FROM users WHERE id = 1
Common use cases
- Making a generated ORM query readable while debugging performance.
- Tidying a query before adding it to a repository.
- Understanding an unfamiliar query with several joins and subqueries.
Limitations and things to watch for
- The formatter is token-based, not a full SQL parser, so it works across dialects but does not understand vendor-specific syntax deeply. String literals, quoted identifiers, and both -- and /* */ comments are preserved exactly.
- Very long expressions inside a single clause are not wrapped, because breaking them safely requires understanding operator precedence.
- Formatting never changes what a query does; only whitespace and keyword case are altered.