Gigsouk

SQL Formatter

Paste a query and get it back with uppercase keywords, one clause per line and indented column lists. Runs entirely in your browser.

Formatted
SELECT
  u.id,
  u.email,
  COUNT(o.id) AS orders,
  SUM(o.total) revenue
FROM users u
LEFT JOIN orders o ON o.user_id = u.id
  AND o.status = 'paid'
WHERE u.created_at >= '2026-01-01'
  AND u.country IN ('US', 'CA')
GROUP BY
  u.id,
  u.email
HAVING COUNT(o.id) > 2
ORDER BY
  revenue DESC
LIMIT 50;

How to use the SQL Formatter

  1. 1Paste your SQL query into the left box.
  2. 2Choose uppercase or lowercase keywords and 2- or 4-space indentation.
  3. 3Copy the formatted query from the right.

Frequently asked questions

Which SQL dialects does the formatter support?

It works with standard SQL and the common syntax of PostgreSQL, MySQL, SQL Server, BigQuery, Snowflake and SQLite. String literals, quoted identifiers and comments are kept exactly as written.

Does formatting change what my query does?

No. Only whitespace and keyword case change; the query's logic, values and identifiers stay the same.

Is my SQL sent anywhere?

No. It runs entirely in your browser — nothing you paste or type is uploaded to our servers or stored.

More free tools

All tools →

Put your skills to work

Thousands of open roles from companies hiring now — apply directly with the employer.