VedaForge developer workbench

DevToolbox

SQL Formatter

Format and beautify SQL for PostgreSQL, MySQL, SQL Server, BigQuery, Snowflake, Spark and 10 more dialects. Formats as you type, with syntax errors shown by line and column.

Processed locally
SQL · UTF-80 bytes
Output
Formatted SQL appears here as you type.
Waiting for input
Workflow 1Paste SQL 2Format

How to use the SQL formatter

  1. Paste a query into Input, open a .sql file, or click Sample.
  2. Pick your dialect so vendor-specific syntax such as BigQuery backtick identifiers, Snowflake QUALIFY, or T-SQL brackets is parsed correctly.
  3. Choose keyword case and indentation. The output updates as you type.
  4. Copy or download the result, or send it to the SQL Complexity Analyser.

What the formatter changes

Only whitespace and keyword case change. Each clause (SELECT, FROM, WHERE, GROUP BY) starts on its own line, columns and conditions are indented under it, and joins line up under FROM. Identifiers, string literals, and comments are kept exactly as written, so the formatted query returns the same results.

Multiple statements separated by semicolons are formatted one after another. Formatting runs in your browser, so queries containing table names or customer data are never uploaded.

Frequently asked questions

Which SQL dialects are supported?

Standard SQL, PostgreSQL, MySQL, MariaDB, SQL Server (T-SQL), BigQuery, Snowflake, Redshift, Spark SQL and Databricks, DuckDB, SQLite, Oracle PL/SQL, Trino/Presto, ClickHouse, Hive, and IBM Db2.

Is my SQL sent to a server?

No. The formatter runs entirely in your browser. Your query is never uploaded or stored.

Why do I get a parse error?

The formatter needs the query to be syntactically complete for the chosen dialect. Check the line and column in the error, make sure brackets and quotes are closed, and confirm the dialect matches your database.

Does formatting change what the query does?

No. Only whitespace and keyword case change. Identifiers, literals, and comments are preserved, so the query returns the same results.

Related tools