SQL Tools

SQL Formatter

Turn messy one-line queries into clean, readable SQL — with dialect-aware formatting for PostgreSQL, MySQL, SQL Server, BigQuery and more.

Loading SQL Formatter…

How it works

How to use the SQL Formatter

  1. Paste SQL

    One query or a whole script with multiple statements.

  2. Pick your dialect

    Dialect-specific syntax such as PostgreSQL casts or T-SQL brackets is handled correctly.

  3. Choose a style

    Keyword case, indentation and spacing between queries. Or switch to Minify for a compact one-liner.

Supported dialects

Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift, Spark SQL, DuckDB, ClickHouse, Trino/Presto, DB2 and Hive. Formatting never changes the meaning of your query: string literals, quoted identifiers and comments are preserved exactly.

Built for developers

Why developers use it

  • Private by design

    Runs 100% in your browser. Nothing you paste is uploaded, logged or stored on a server.

  • Instant results

    Output updates as you type, with precise error locations when something is wrong.

  • Works offline

    Once loaded, the tool keeps working without a connection. Install it as an app if you like.

  • Free, no sign-up

    No accounts, no limits, no watermarks.

FAQ

Frequently asked questions

Why did formatting fail?

The formatter parses your SQL, so unbalanced parentheses or quotes cause an error with a line and column. Choosing the matching dialect also helps with vendor-specific syntax.

Does minifying remove comments?

Yes. Minify removes comments and collapses whitespace, but never touches the contents of strings or quoted identifiers.

Is my data uploaded anywhere?

No. This tool runs entirely in your browser. Your input never leaves your device, is not logged, and works offline once the page has loaded.

Keep going

Related tools

Private by design

Your data never leaves your browser.

498 free tools that run locally — no uploads, no sign-up, no tracking of what you paste. They even work offline.

  • 498free tools
  • 0bytes uploaded
  • 23categories