SQL Formatter
Format and indent SQL queries for readability.
Processed locally in your browser. Nothing you enter is uploaded or stored.
- Clause-aware indentation — SELECT, FROM, JOIN, WHERE and GROUP BY line up.
- Consistent keyword casing, your choice of upper or lower.
- Runs in your browser; queries aren't uploaded.
Why this is private
- Processed locally in your browser. Nothing you enter is uploaded or stored.
- Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
- Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.
Overview
Reformats a single-line or inconsistently indented SQL query into a readable, consistently indented statement.
How to use it
- 1Paste a SQL query.
- 2Choose keyword casing (UPPERCASE or lowercase).
- 3The formatted query appears instantly.
Tips
- Formatting is keyword- and clause-aware but dialect-agnostic — review complex vendor-specific syntax (e.g. T-SQL hints) before running the result.
Frequently asked questions
What people use it for
Read a query pulled from application logsBreak a one-line ORM-generated statement into readable clauses.
Review a complex query before running itIndentation makes a missing join condition or misplaced filter obvious.
Standardise SQL in a migration or PRFormat everyone's queries the same way before committing.
Prepare a query for documentationA clean, cased statement to paste into a runbook or wiki.
Related guides
- How to read JSON with a tree viewerA tree viewer turns a wall of brackets into a structure you can expand, search and copy paths from. Here's how to use one effectively.
- JSON parse errors explained: 'Unexpected token', 'Expected comma or brace', and the restWhat each common JSON error message actually means, the usual cause, and how to find the spot fast using line and column.
- How to format JSON (and actually understand the errors)JSON looks like a JavaScript object but follows stricter rules. Here's what those rules are and how to read the errors when they're broken.
Related tools
All developer toolsSQL MinifierStrip comments and collapse whitespace to compress SQL.JSON Viewer & FormatterView, format, validate, edit and beautify JSON with an interactive tree view, plus a shareable link.HTML FormatterFormat and indent HTML markup for readability.JSON ValidatorValidate JSON syntax and pinpoint errors instantly.
Ready to use SQL Formatter?
SQL Formatter