Daily Tools (126)/Postgres · MySQL

SQL Query Formatter & Beautifier

Format minified or messy SQL queries into clean, indented clauses (SELECT, FROM, JOIN, WHERE, GROUP BY, ORDER BY) with 100% client-side privacy.

Formatted SQL
SELECT u.id,
  u.email,
  count(o.id) as total_orders 
FROM users u 
LEFT 
JOIN orders o on o.user_id = u.id 
WHERE u.active = true 
  AND o.amount > 500 
GROUP BY u.id,
  u.email 
ORDER BY total_orders desc 
LIMIT 25;
Try next

How to use SQL Query Formatter & Beautifier

  1. 1Paste any raw or single-line SQL query.
  2. 2Choose Uppercase Keywords and 2-Space or 4-Space indentation.
  3. 3View the cleanly broken-out SELECT columns, JOINs, and WHERE conditions.
  4. 4Copy formatted SQL or minify back to a single line.

Frequently Asked Questions

Are my table names or customer WHERE filters sent to a server?

Never—formatting runs 100% in your browser.

Can I also minify SQL into a single line?

Yes—click Minify SQL to collapse whitespace safely.