Developer

SQL formatter

Format your SQL queries: keywords and indentation.

  • Instant
  • Free
  • Private (processed locally)
  • No sign-up
Result

A readable SQL query reviews in seconds

A query written on a single line quickly becomes unreadable. This formatter reorganises it clause by clause: each SELECT, FROM, WHERE on its line, columns aligned, AND/OR indented. The meaning stays the same, the reading becomes obvious.

  1. Paste your query

    On one line, badly indented, whatever.

  2. Format

    Keywords uppercased (optional) and clauses separated.

  3. Copy

    A clean version, ready for review or docs.

Before / after

StepContent
Inputselect id, name from users where age > 18 order by name
SELECTSELECT id, name
FROM / WHEREFROM users WHERE age > 18
ORDER BYORDER BY name

A lightweight, readability-focused formatter, compatible with keywords common to PostgreSQL, MySQL, SQLite and SQL Server. It does not validate syntax: an exotic keyword is simply left as is.

Frequently asked questions

Why uppercase the keywords?

It is a widespread readability convention: SELECT, FROM, WHERE in uppercase stand out at a glance from lowercase table and column names. SQL is case-insensitive for keywords, so it is purely cosmetic but standard in teams.

Does formatting change the query result?

No: line breaks, indentation and keyword case have no effect on execution. The query returns exactly the same data, just easier to read.

Does this formatter handle every SQL dialect?

It is a lightweight, readability-focused formatter: it recognises common keywords (SELECT, JOIN, GROUP BY…) shared by PostgreSQL, MySQL, SQLite, SQL Server. Functions or syntax very specific to one engine may not be indented ideally.

Can I turn off the uppercasing?

Yes, a checkbox controls it. Uncheck it to only reorganise the layout (line breaks, indentation) while keeping the original case of your keywords.