Skip to content

SQL Formatter

Coming soon

Format SQL queries with consistent indentation and keyword case.

Tell us this tool matters to you. The tools with the most interest are built first.

What is SQL Formatter?

A SQL formatter rewrites a query with consistent line breaks, indentation and keyword case, without changing what it does. A query copied from a log or an ORM on a single line becomes easy to read and review.

Useful for

  • Reading queries captured from logs or ORMs.
  • Standardizing SQL before a code review.
  • Debugging long queries with many joins and subqueries.

How to use

  1. Paste your SQL query.
  2. Choose the dialect and the keyword case.
  3. Copy the formatted query.

Examples

A one-line query

Input
select id,name from users where active=1 order by name
Output
SELECT
  id,
  name
FROM
  users
WHERE
  active = 1
ORDER BY
  name

Frequently asked questions

Does formatting change the result of the query?

No. Only whitespace and keyword case change; the query logic stays exactly the same.

Which SQL dialects will be supported?

Standard SQL, PostgreSQL, MySQL, SQL Server and SQLite are planned.

When will this tool be available?

It is on our roadmap. Click "I want this tool" on this page to tell us it matters to you — the tools with the most interest are built first.

Available now