SQL Formatter & Beautifier

Format and beautify messy SQL with proper indentation and uppercase keywords, for MySQL, PostgreSQL, SQLite and more — 100% in your browser.

Mode:
Formatted
SELECT
  id,
  name,
  email
FROM
  users u
  JOIN orders o ON o.user_id = u.id
WHERE
  u.active = 1
ORDER BY
  name;

🔒 Formatted in your browser — nothing is uploaded.

Turn one-line SQL into readable queries

Paste a query and get it formatted with consistent indentation, line breaks before major clauses (SELECT, FROM, JOIN, WHERE, GROUP BY, ORDER BY) and uppercased keywords. Pick your database dialect — Standard SQL, MySQL, PostgreSQL, SQLite, MariaDB, BigQuery, Oracle PL/SQL or SQL Server (T-SQL) — so dialect-specific syntax is handled correctly. Formatting is powered by the widely used sql-formatter engine, so even long queries with subqueries and joins come out clean and consistent.

Why formatting matters

Readable SQL is easier to review, debug and hand off. A well-indented query makes it obvious which conditions belong to which clause and where a join or subquery begins and ends, which helps catch mistakes like a misplaced AND or a missing GROUP BY column. Consistent formatting also makes code reviews and version-control diffs smaller and clearer. The whole thing runs in your browser, so queries that reference real table and column names never leave your machine.

Frequently asked questions

Which SQL dialects are supported?

Standard SQL, MySQL, PostgreSQL, SQLite, MariaDB, BigQuery, Oracle PL/SQL and SQL Server (T-SQL). Choosing the right dialect ensures dialect-specific syntax is formatted correctly.

Does it change what my query does?

No. Formatting only changes whitespace and keyword casing for readability. The logic of your query is unchanged — it runs exactly the same as before.

Is my SQL sent to a server?

No. Formatting happens entirely in your browser. Your query, including any table or column names, never leaves your device and is not stored.