SQL Formatter & Beautifier — Postgres, MySQL Format SQL across Postgres, MySQL, SQLite, and T-SQL.
100% offline
Input30 chars · 1 lines
Output38 chars
Formatted · 1 statement
SELECT
  *
FROM
  users
WHERE
  id = 1

About SQL Formatter & Beautifier — Postgres, MySQL

SQL copied from an ORM log, a stack trace, or a teammate's message is almost always a single dense line — no breaks, inconsistent casing, impossible to read. This free SQL formatter cleans it up instantly: it normalizes indentation, applies consistent keyword casing, and breaks clauses onto their own lines so a query reads the way you'd write it by hand.

It's dialect-aware. Pick PostgreSQL, MySQL, SQLite, MariaDB, BigQuery, or T-SQL and the formatter respects each one's quoting and identifier rules — MySQL backticks and Postgres double-quotes are preserved rather than mangled. Multi-statement scripts are formatted as a unit, and a one-click Minify collapses everything back to a compact single line.

Everything runs entirely in your browser. Your queries — which often contain schema names, table structures, or sample data — never leave your device.

Features

  • Format or minify with one click
  • Dialect-aware: Postgres, MySQL, SQLite, MariaDB, BigQuery, T-SQL
  • Choose keyword casing (UPPER / lower / preserve) and indent width
  • Preserves dialect-specific quoting and handles multi-statement scripts
  • Runs fully offline — nothing is uploaded

How to use

  1. Paste your SQL into the input pane.
  2. Pick the dialect, keyword case, and indent width from the toolbar.
  3. Click Format to pretty-print, or Minify to collapse to one line.
  4. Copy the result from the output pane.

Frequently asked questions

Which SQL dialects are supported?

Standard SQL plus PostgreSQL, MySQL, SQLite, MariaDB, BigQuery, and T-SQL (SQL Server). Selecting the right dialect keeps quoting and identifiers correct for that engine.

Does it change my keyword casing?

Only if you ask it to. The Keywords selector lets you uppercase keywords (the default), lowercase them, or preserve whatever casing you pasted.

What does Minify do?

Minify normalizes the query and then collapses all whitespace into single spaces, producing a compact one-line statement — handy for embedding SQL in code or config.

Is my SQL sent to a server?

No. Formatting happens entirely in your browser. Your queries, schema names, and any inline data never leave your device.

Can it format multiple statements at once?

Yes. Paste a whole script separated by semicolons and each statement is formatted consistently as part of the same output.

Everything runs locally in your browser — your input is never uploaded.