SQL formatter

Paste SQL, pick a dialect, and get it indented and keyword-cased consistently.

Formatted SQL

SELECT
  o.id,
  o.customer_id,
  sum(oi.qty * oi.price) AS total
FROM
  orders o
  JOIN order_items oi ON oi.order_id = o.id
WHERE
  o.status = 'paid'
GROUP BY
  o.id,
  o.customer_id
ORDER BY
  total DESC;

Runs in your browser. Nothing you type is sent anywhere.

How this works

Do this against your live database in Tablyne.

PostgreSQL GUI →

FAQ

Which dialects are supported? +

PostgreSQL, MySQL/MariaDB, SQLite, T-SQL (SQL Server), DuckDB, and Athena/Trino.

Does formatting change what my query does? +

No — only whitespace, line breaks and keyword casing change; the SQL itself is untouched.

Why isn't PartiQL an option? +

The formatting library this tool uses doesn't support PartiQL's syntax; DynamoDB's PartiQL statements are simple enough to format by hand.