Format · beautify · dialects

SQL formatter

Paste a messy SQL query and get clean, readable, properly indented SQL. Pick your dialect and keyword case.

Input

1 lines125 B

SQL

13 lines141 B

SELECT
  id,
  name,
  email
FROM
  users u
  JOIN orders o ON o.user_id = u.id
WHERE
  u.active = 1
ORDER BY
  o.created_at DESC
LIMIT
  10;

Frequently asked questions

Which SQL dialects are supported?

Standard SQL plus popular dialects — pick the one matching your database for the best formatting.

Does formatting change my query?

No. It only reformats whitespace, casing and indentation; the query logic is unchanged.

Is my query uploaded?

No. SQL formatting runs entirely in your browser.