Skip to content
yutils
Example

Input (minified SQL)

SELECT id, name, email FROM users WHERE active = true AND created_at > '2026-01-01' ORDER BY created_at DESC LIMIT 10;

Output (formatted)

SELECT
  id,
  name,
  email
FROM
  users
WHERE
  active = TRUE
  AND created_at > '2026-01-01'
ORDER BY
  created_at DESC
LIMIT
  10;

Note

Supports PostgreSQL, MySQL, SQLite, MSSQL, BigQuery, and others. CTEs, window functions, and JOINs all get indented properly.

Usage / FAQ

When to use

  • Tidy SQL quickly without firing up DBeaver / DataGrip / MySQL Workbench
  • Make SQL readable before pasting into issues, Slack, or Notion
  • Break down complex CTEs, subqueries, and JOINs visually
  • Normalize keyword casing across dialects (PostgreSQL, MySQL, BigQuery, …)
  • Self-review queries before code review

FAQ

Q.Which SQL dialects are supported?
A.Pick one of four: Standard SQL, PostgreSQL, MySQL, or SQLite. The dialect changes how keywords and quoted identifiers (` and ") are handled.
Q.Can formatting fail?
A.If the SQL has a syntax error, you get a parse-failure notice with the error position (line and column) instead of output. For dialect-specific syntax, try another dialect option. Very large or complex SQL (an IN list with tens of thousands of items, parentheses nested hundreds deep, …) runs on a separate thread and stops after 8 seconds — the page stays responsive meanwhile.
Q.Is the query actually executed?
A.No — this tool only formats. There is no DB connection and no execution. Your SQL never leaves the browser.
Fun facts
  • SQL traces back to Edgar F. Codd's 1970 paper 'A Relational Model of Data for Large Shared Data Banks' — the mathematical foundation of the relational model. On top of it, IBM's San Jose lab built SEQUEL (System Englishlike QUEry Language) in 1974, later shortened to SQL after a trademark conflict.

    Wikipedia — SQL history
  • SQL standards are managed by ANSI/ISO — SQL-86 (the first), SQL-92 (the most influential, where most of 'SQL syntax' was nailed down), then SQL:1999, :2003, :2008, ..., :2023. But every real database (Postgres / MySQL / Oracle) ships its own dialect, so 100% compatibility is a fantasy.

    Wikipedia — SQL standards
  • The uppercase-keywords convention (`SELECT`, `FROM`, `WHERE`) is a relic of 1970s–80s monochrome terminals — without syntax highlighting, case differences provided visual structure. Modern IDEs colorize everything, but the convention stuck. Lowercase SQL is exactly equivalent — purely an aesthetic choice for readability.

    Wikipedia — SQL syntax