Format and minify SQL with dialect-aware rules, indentation, keyword casing, optional leading commas, and CodeMirror highlighting—ideal for DB work and reviews.
Format SQL online for MySQL, PostgreSQL and other dialects. Customize indentation, keyword case and comma style to make queries easier to read and review.
How to use
When to use
Clean up messy queries, align style before sharing, or prep SQL for documentation.
Workflow
- Pick the dialect and indent settings that match your engine.
- Paste SQL, upload a file, or load the sample.
- Click Format or press Ctrl/Cmd+Enter; use Minify when you need a compact payload.
- Copy or download the result; drag the handle to resize the editor.
Tips
- Leading commas can change layout versus the dialect default—review the output if you share it widely.
- If another page links here with ?sql=, the editor auto-fills from the decoded value.