Format SQL online: MySQL, Postgres, BigQuery & more

Turn a one-line, copy-pasted, or minified query into clean, readable SQL. Yellorn formats across the common dialects and repairs markdown fences and smart quotes first.

A query copied out of a log line, an ORM, or a chat message usually arrives as one long line — or worse, wrapped in a markdown fence with smart quotes. Yellorn pretty-prints it into clean, indented SQL with consistent keyword casing, in your browser, in one click.

  1. Paste your SQL into the editor. Yellorn auto-detects the SQL format when the text starts with a statement keyword — or pick SQL from the format selector.
  2. Press Cmd + Shift + F (Smart Format) or click Smart Format in the toolbar.

For example, this:

select id,name,email from users where active=true and created_at>'2026-01-01' order by created_at desc limit 10;

becomes this:

SELECT
  id,
  name,
  email
FROM
  users
WHERE
  active = true
  AND created_at > '2026-01-01'
ORDER BY
  created_at DESC
LIMIT
  10;
SQL editor tab after Smart Format — a one-line query is now indented across 13 lines with SELECT, FROM, WHERE, ORDER BY, and LIMIT each on their own line and keywords highlighted
Smart Format turns a one-line query into readable, indented SQL with keywords uppercased — one click, nothing sent to a server.
  • Smart Format (Cmd + Shift + F) repairs common paste damage first — markdown ```sql fences, smart quotes outside string literals, a byte-order mark, zero-width characters — then pretty-prints.
  • Simple Format (Alt + Shift + F) pretty-prints without the repair pass, when you want the formatter to leave your input untouched apart from layout.

The formatter handles the common-denominator grammar across MySQL, PostgreSQL, BigQuery, Snowflake, Athena (Trino), SQL Server, Oracle, and SQLite — so a query from almost any database lays out cleanly.

Everything runs locally; your query is never sent to a server. You can also convert a formatted query into a Python cursor.execute(...) snippet from the Format selector menu.

How do I format a minified SQL query online?

Paste the query into the Yellorn editor — it auto-detects SQL when the text starts with a statement keyword — and press Cmd/Ctrl + Shift + F (Smart Format). Yellorn returns clean, indented SQL with consistent keyword casing, in your browser.

Which SQL dialects does the formatter support?

It handles the common grammar across MySQL, PostgreSQL, BigQuery, Snowflake, Athena (Trino), SQL Server, Oracle, and SQLite, so a query from almost any database lays out cleanly.

What's the difference between Smart Format and Simple Format?

Smart Format (Cmd/Ctrl + Shift + F) first repairs common paste damage — markdown ```sql fences, smart quotes outside string literals, a byte-order mark, and zero-width characters — then pretty-prints. Simple Format (Alt + Shift + F) only pretty-prints, leaving your input otherwise untouched.

Is my SQL sent to a server?

No. Formatting runs entirely in your browser, so the query is never uploaded. You can also convert a formatted query into a Python cursor.execute(...) snippet from the Format selector (Convert rows).

Try a fix in the editor or browse more articles.