Free · Runs in your browser · 14 dialects

SQL Formatter

Paste messy SQL, get clean, readable, properly indented queries.

Input0 lines · 0 chars
Formatted
0 lines
Formatted SQL will appear here…

Supported SQL dialects

Standard SQLMySQLMariaDBPostgreSQLSQLiteOracle (PL/SQL)SQL Server (T-SQL)BigQuerySnowflakeRedshiftSpark SQLDB2N1QL (Couchbase)Trino / Presto

Frequently asked questions

Is my SQL sent to a server?

No — formatting runs entirely in your browser using a JavaScript library. Your queries never leave your device.

Which SQL dialects are supported?

Standard SQL plus MySQL, PostgreSQL, SQL Server, Oracle PL/SQL, SQLite, BigQuery, Snowflake, Redshift, Spark, DB2, N1QL and Trino. Dialect mostly affects how certain vendor-specific syntax is parsed — for plain queries, Standard SQL usually works fine.

Why did formatting fail on my query?

This usually means an unmatched quote, bracket, or parenthesis somewhere in the query, or syntax specific to a dialect you haven't selected. Double-check those first.

Does this validate that my SQL is correct?

Not fully — it tokenizes and reformats your query's structure, which catches some issues like unmatched brackets, but it isn't a full SQL parser or query validator against a real database schema.

Can I format multiple statements at once?

Yes — separate statements with semicolons and they'll each be formatted with a blank line between them.