SQL Formatter
Paste messy SQL, get clean code. SQL formatting happens locally in your browser.
Formatting preserves identifiers and aliases. Style suggestions are not database validation. Maximum input: 100,000 characters.
Turning history off also clears saved queries. Shared links contain your SQL; only share queries you intend others to read.
What would make this tool more useful?
One click helps decide what gets built next.
Tell us more in your own words (optional)
What you write here is never sent to analytics and never reaches our servers. The button opens your own email app with the text filled in, so you can see and edit exactly what is sent before it leaves your device. Please do not include confidential SQL.
Compose emailClient-Side Only
SQL formatting happens locally in your browser. Analytics records usage metadata, not SQL text. See our privacy details.
9 Dialects
PostgreSQL, MySQL, SQL Server, BigQuery, SQLite, MariaDB, Redshift, and Snowflake.
Saves Settings
Your indent size, keyword case, and dialect preferences are saved locally between sessions.
Query History
Optionally keeps your last 5 queries in this browser. Turn history off or clear it at any time.
Stop Squinting at One-Line Queries
Paste messy SQL, get readable code. SQL is processed locally in your browser.
select u.id,u.name,u.email,o.total,o.created_at from users u inner join orders o on u.id=o.user_id where u.status='active' and o.total>100 order by o.created_at desc limit 10;
SELECT u.id, u.name, u.email, o.total, o.created_at FROM users u INNER JOIN orders o ON u.id = o.user_id WHERE u.status = 'active' AND o.total > 100 ORDER BY o.created_at DESC LIMIT 10;