SQL formatter
A query you can read, from one you were handed.
Output
Paste or type above to see the result here.
Your files stay on your device
This tool runs entirely in your browser. What you paste is processed on your device and is never sent to a server, so it is safe to use with tokens, keys and unpublished text.
How it works
- Paste the SQL.
- Choose how keywords are written and how far each level is indented.
- Copy the result, or keep editing: it is laid out again as you type.
Frequently asked questions
- Will it break a query it does not understand?
- It does not try to understand it. The text is split into words, strings and comments and laid out by clause, so a half-written query, a dialect it has never seen or a stored procedure all come back formatted rather than refused.
- Are my strings and comments safe?
- Yes. Anything in quotes, backticks or brackets, and every -- or /* */ comment, is carried through character for character.
- Is the SQL sent anywhere?
- No. It is formatted in your browser as you type, which matters when the query has real table names in it.
Related tools
{} JSON Formatter Paste JSON, get it indented, minified or validated instantly. Your data stays on this page. ‹› XML formatter Indented to be read, or squeezed to one line to be sent. ⇄ Converters CSV to JSON Turn spreadsheet exports into JSON for APIs, scripts and config files, without your data leaving the page. ≠ Text tools Text Diff Paste two versions of a text and see exactly which lines changed.