SQL Formatter & Minifier

Make SQL readable or compact it while preserving quoted values.

Your SQL is processed entirely in this browser and is never sent to a database or server.

Formatting is not validation. Always review and test a query before running it, especially after removing comments.

193 characters

Formatted SQL

SELECT u.id,
  u.name,
  COUNT(o.id) AS order_count
FROM users u
  LEFT JOIN orders o ON o.user_id = u.id
WHERE u.active = 1
  AND u.created_at >= '2026-01-01'
GROUP BY u.id,
  u.name
ORDER BY order_count DESC;

210 characters

Related Tools