SQL Formatter
Runs in browserFormat SQL queries with readable indentation instantly.
Format SQL queries with readable indentation and line breaks. Paste SQL and get clean, consistent SQL. Runs entirely in your browser.
SQL Formatter tool
Keywords
Files never leave your browser.
Drag and drop a file here, or tap to select
Formatted SQL
SELECT
u.id,
u.name,
u.email,
o.total,
o.created_at
FROM
users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE
u.active = true
AND o.total > 100
ORDER BY
o.created_at DESC
LIMIT
20🔒 Runs in your browser · No uploads · Your data never leaves your device
How to use
Paste or upload SQL
Paste SQL or load a .sql file.
Review formatted output
The output updates as you type.
Copy or download
Copy the formatted SQL or download it with a .sql extension.
Common use cases
- Reviewing a long query for a bug — Paste a minified or poorly indented SQL query to get a formatted version that makes JOIN conditions and WHERE clauses readable.
- Preparing SQL examples for documentation — Format queries consistently before adding them to wiki pages, PR descriptions, or API docs.
Examples
SELECT query
Multi-line formatting for readability.
InputSELECT id,name FROM users WHERE active=1 ORDER BY id;OutputSELECT id, name FROM users WHERE active = 1 ORDER BY id ;
Frequently asked questions
- Is my SQL sent to a server?
- No. Formatting runs locally in your browser.
- Which SQL dialects are supported?
- Common SQL dialects are supported; formatting may vary slightly by dialect.
Key concepts
- SQL
- Structured Query Language — the standard language for interacting with relational databases like PostgreSQL, MySQL, and SQLite.
- Query formatting
- Applying consistent indentation and capitalization to SQL statements to make them readable and easier to debug.
Related tools
You might find these useful too.