Format SQL for Code Review
Format SQL queries with readable indentation for reviews and debugging.
Open SQL Formatter with a ready-to-run example.
- You need to review a long SQL query quickly.
- You are debugging performance issues in complex SQL.
- You want a consistent SQL style before sharing.
- Paste SQL into the SQL Formatter input.
- Choose keyword casing and indentation style.
- Copy the formatted output for review.
- Break long SELECT lists onto new lines for readability.
- Use consistent keyword casing (UPPER) in teams.
- Format before adding comments to reduce churn.
Simple SELECT
select id,name,created_at from users where status='active' and created_at >= '2025-01-01' order by created_at desc;
SELECT id, name, created_at FROM users WHERE status = 'active' AND created_at >= '2025-01-01' ORDER BY created_at DESC;
Join with filters
select o.id, o.total, c.name from orders o join customers c on o.customer_id = c.id where o.status = 'paid' and o.total > 100;
SELECT o.id, o.total, c.name FROM orders o JOIN customers c ON o.customer_id = c.id WHERE o.status = 'paid' AND o.total > 100;
It is a lightweight formatter aimed at common SQL patterns.
Yes. Choose upper or lower case keywords.
Yes, it formats each statement in sequence.
No. It runs locally in your browser. No uploads.
Privacy-first: runs locally in your browser. No uploads.