SQL Formatter
✓ Link copiedFormat messy, minified, or one-line SQL into clean, readable queries right in your browser. Paste any statement and it is instantly pretty-printed with each clause on its own line, consistent indentation, and tidy keyword casing. Choose your SQL dialect — Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, BigQuery, Snowflake, Amazon Redshift, Spark, T-SQL, PL/SQL, or Db2 — so dialect-specific syntax is parsed correctly. Pick uppercase, lowercase, or preserved keywords and set the indent to 2, 4, or 8 spaces or tabs. Everything runs locally, so even queries from production systems never leave your device. Free, fast, and private.
Formatting runs entirely in your browser — your SQL is never uploaded.
How to use
Paste or type your SQL into the input box, or click Sample to load an example query. The formatted result appears instantly below — copy it with one click. Use the Dialect selector to match your database so dialect-specific syntax is handled correctly, choose how keywords are cased (UPPERCASE, lowercase, or preserved), and set the indentation to 2, 4, or 8 spaces or tabs. Use Clear to start over.
Frequently asked questions
- Which SQL dialects are supported?
- The formatter understands Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, BigQuery, Snowflake, Amazon Redshift, Spark SQL, T-SQL (SQL Server), PL/SQL (Oracle), and IBM Db2. Selecting the right dialect helps the parser handle dialect-specific keywords and operators so the output is formatted correctly.
- Does formatting change what my query does?
- No. Formatting only adjusts whitespace, line breaks, indentation, and keyword casing for readability — it never rewrites your logic, reorders clauses, or alters identifiers, string literals, or values. The query you get back is functionally identical to the one you pasted.
- Is my SQL uploaded anywhere?
- No. The entire formatting process happens locally in your browser — nothing is sent to a server, logged, or stored. That makes it safe to format queries from real systems, including ones that contain table names or values you would not want to share.