SQL Formatter
Format and indent SQL queries for readability.
This is a heuristic formatter for common SQL clauses (SELECT, JOIN, WHERE, GROUP BY, etc.) — it does not parse a full SQL grammar, so unusual dialect syntax may not format perfectly.
SQL Input
Formatted SQL
About the SQL Formatter
Paste minified or messy SQL and get it reformatted with keywords on new lines and consistent indentation, making SELECT, JOIN, WHERE, and GROUP BY clauses easy to scan.
Examples
Format SELECT
select id,name from users where active=1Output
SELECT id,
name
FROM users
WHERE active=1Keyboard shortcuts
- Copy the main outputCtrl / ⌘ + Shift + C
- Download the resultCtrl / ⌘ + S
- Share this toolCtrl / ⌘ + Shift + S
- Reset the inputsAlt + R
- Open the tool search paletteCtrl / ⌘ + K
Related tools
SQL Playground & Query Runner
Dev Utilities
Write schema and seed SQL, then run queries against an in-memory database.
SQL Query Analyzer
Dev Utilities
Find expensive SQL patterns, missing filters and index opportunities.
SQLite Database Viewer & Query Runner
Dev Utilities
Open a .sqlite/.db file in your browser and run SQL against it.
Code Minifier & Beautifier
Dev Utilities
Minify or beautify JavaScript, CSS, HTML, JSON, XML and SQL.
.editorconfig Generator
Dev Utilities
Create an .editorconfig file with per-language overrides.
.htaccess Redirect Generator
Dev Utilities
Generate Apache .htaccess redirect and rewrite rules.
Frequently asked questions
Read more
- Debugging slow SQL queries: an index primer
Reading EXPLAIN output, understanding why an index gets ignored, and the indexing patterns that fix most slow queries.
Version 1.0.0 · Updated 2026-08-07 · Runs entirely in your browser