OmniTools

SQL formatter

Readable SQL for Postgres, MySQL and SQL Server dialects.

Nothing you enter is sent anywhere

Keywords

Formatted

SELECT u.id,
  u.name,
  count(o.id) as orders
FROM users u
LEFT JOIN orders o
  ON o.user_id = u.id
WHERE u.city = 'Kandy'
  AND u.active = true
GROUP BY u.id,
  u.name
ORDER BY orders desc
LIMIT 20

String literals are tokenised before formatting, so a value like 'sent from London' keeps its wording. Regex-only formatters split that on the word "from" and quietly corrupt the query.