SQL Formatter
Turn a wall of SQL into a readable, consistently indented query. Paste any statement, pick your dialect — PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, BigQuery, Snowflake, Redshift, or Spark — choose the keyword casing, and get cleanly formatted output powered by the open-source sql-formatter library. Formatting runs locally, so production queries with table names and data stay on your machine.
Developer Tools
Private by default
This tool runs entirely in your browser. Your data is never uploaded to a server.
How to use
3 clear steps.
Paste your SQL query.
Select the SQL dialect and keyword casing.
Click Format and copy the readable result.
Good to know
Frequently asked questions
- Does formatting change what the query does?
- No — only whitespace and keyword casing are adjusted. Identifiers, literals, and query structure are untouched, so the formatted query executes identically.
- Why does the dialect matter?
- Dialects differ in operators, quoting, and syntax extensions (e.g. T-SQL's TOP, PostgreSQL's ::casts, BigQuery's backticks). Picking the right dialect keeps those constructs parsed and formatted correctly.
- Is it safe to paste production queries?
- Yes — formatting runs entirely in your browser and nothing is transmitted or stored.