Skip to content
Spellkit

SQL Formatter

Beautify SQL queries per dialect or minify to one line — all in your browser.

Formatting runs locally — your query never leaves this browser.

What is SQL Formatter?

SQL Formatter beautifies SQL queries with the keyword case and indentation you choose, or minifies them to a single line. It understands eleven dialects — MySQL, PostgreSQL, SQLite, MariaDB, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Spark, Hive, and standard SQL — so dialect-specific syntax like [brackets] and `backticks` formats correctly. Everything runs in your browser: queries are never uploaded.

Key features

  • Eleven dialects: MySQL, PostgreSQL, SQLite, T-SQL, PL/SQL, BigQuery, Snowflake and more
  • Keyword case control — UPPERCASE, lowercase, or keep as typed
  • Indent with 2 spaces, 4 spaces, or tabs
  • One-click minify collapses a query to a single line (string literals kept intact)
  • Runs entirely in your browser — queries never leave your machine

SQL Formatter — beautify & minify queries online

Paste any SQL query and get it back consistently formatted — keywords cased the way your team likes, clauses on their own lines, and nesting indented. Or go the other way and minify a query to a single line for logs and code.

Dialects

The formatter understands eleven dialects: standard SQL, MySQL, PostgreSQL, SQLite, MariaDB, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Spark SQL, and Hive. Picking the right dialect matters when your query uses dialect-specific syntax — [bracketed identifiers] in T-SQL, `backticks` in MySQL, :: casts in PostgreSQL — so the formatter can parse it correctly.

Formatting options

  • Keywords — write SELECT/FROM in UPPERCASE, lowercase, or leave them exactly as typed.
  • Indent — 2 spaces, 4 spaces, or tabs.
  • Multiple statements separated by ; are formatted together, with a blank line between them.

Minify

Minify collapses a query to one line: whitespace runs become single spaces, -- line comments are dropped (they would swallow the rest of the line), and /* block comments */ are kept. Whitespace inside 'string literals' is never touched.

Privacy

Formatting runs entirely in your browser. Queries are never uploaded, logged, or stored — safe for production SQL.

Privacy

SQL Formatter runs entirely in your browser. Your files and data are processed on your device and never uploaded to any server. There is no account to create and nothing to install — open the page and start working.