SQL Formatter
Format and beautify SQL for PostgreSQL, MySQL, SQLite, BigQuery and more. Queries stay in your browser.
No uploads
SELECT u.id, u.name, count(o.id) AS orders FROM users u LEFT JOIN orders o ON o.user_id = u.id WHERE u.created_at > '2026-01-01' AND u.active = TRUE GROUP BY u.id, u.name HAVING count(o.id) > 3 ORDER BY orders DESC LIMIT 20;
How to use SQL Formatter
- 1Open SQL Formatter. It runs in your browser, no sign-up.
- 2Type or paste your input.
- 3Copy or download the result.
Questions
Is my query sent anywhere?
No. Formatting happens in your browser — safe for production queries.
Does it validate SQL?
It reports syntax it cannot parse, but it does not check tables or columns.
More tools
JSON Formatter & ValidatorPretty-print, minify, validate Base64 Encoder & DecoderText and files Hash GeneratorMD5, SHA-1, SHA-256, SHA-512 Password & UUID GeneratorStrong, random, local Regex TesterLive matches and groups JWT DecoderHeader, payload, expiry Diff CheckerCompare two texts CSV ↔ JSON ↔ YAML ↔ XMLConvert data formats