SQL Formatter

Paste your messy SQL and get clean, formatted code instantly.

Input
0 characters, 0 lines
Ctrl + Enter
Output
0 characters, 0 lines

Stop Squinting at One-Line Queries

Paste messy SQL, get readable code. Works offline, nothing leaves your browser.

Before
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;
After
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;

Client-Side Only

Everything runs in your browser. Your SQL never hits a server, so there's nothing to leak.

Multiple Dialects

Handles PostgreSQL, MySQL, SQL Server, BigQuery, SQLite, MariaDB, Redshift, and Snowflake.

Remembers Settings

Your indent size, keyword case, and dialect preferences are saved locally between sessions.

Query History

Keeps your last 5 formatted queries so you can pull them back up without re-pasting.

Supported Databases

Keyboard Shortcuts

Ctrl + Enter Format SQL
Ctrl + Shift + C Copy output
Ctrl + K Clear all