Developer
100% Browser-Side · Private & Secure

SQL Formatter

Prettify, indent, and format messy SQL queries with clause structuring and keyword capitalization.

Raw SQL Query

Paste minified or messy SQL statements

Formatted SQL Query

Clean indentation and clause separation

SELECT u.id, u.name, u.email, count(o.id) AS total_orders, sum(o.amount) AS total_spent
FROM users u
LEFT
JOIN orders o ON u.id = o.user_id
WHERE u.active = true
  AND (o.status = 'completed'
  OR o.status = 'shipped')
GROUP BY u.id, u.name, u.email
HAVING sum(o.amount) > 500
ORDER BY total_spent DESC
LIMIT 50;

Related Tools

Frequently used companion utilities for this workflow