SQL Formatter
Pretty-print a SQL query with consistent indentation and keyword casing.
Dialects differ on quoting and on which words are reserved.
What it does
SQL Formatter reads the whole document before doing anything, so what comes back is either valid output or a specific error with the position that caused it — not a partially rewritten file.
When you need it
Usually when something has already gone wrong: a config file an application will not load, an API response that has to be read by a human, or an export that has to be checked before it goes anywhere near a database.
Limits and caveats
Key order is preserved as it appears in the input. Very large documents are limited by your device's memory rather than by an upload cap, since the parsing happens locally. Everything happens in your browser, so the file never leaves your device.
How to use the SQL Formatter
- Paste your content, or load a file.
- The result appears as you type.
- Copy or download the output.
Frequently asked questions
- Why do I need to pick a dialect?
- Because they disagree about quoting and about which words are reserved. If a valid query fails to parse, it is usually parsing as the wrong dialect.
- Do my files get uploaded?
- No. This tool runs entirely in your browser, so the file never leaves your device.