SQL Formatter
Paste SQL and format it for readability. Choose the SQL dialect (Standard SQL, PostgreSQL, MySQL, SQL Server, SQLite, BigQuery, or Snowflake), keyword case, and indentation. Formatting runs locally in your browser — your SQL is not executed, sent to a database, or sent to PocketSpry’s AI API.
Format SQL for easier reading
Paste SQL, choose the dialect and formatting style, and PocketSpry formats it locally in your browser. Formatting rearranges whitespace and adjusts keyword case for readability — your SQL is never executed, sent to a database, or sent to PocketSpry’s AI API.
Choose the right SQL dialect
SQL syntax varies between PostgreSQL, MySQL, SQL Server, SQLite, BigQuery, Snowflake, and standard SQL. Choose the dialect explicitly rather than relying on guessing — the same SQL can format differently under different dialects, so PocketSpry does not auto-detect it.
Formatting is not SQL validation
The formatter rearranges whitespace and keyword presentation. It does not connect to your database, inspect your schema, or prove the query will execute. A query that formats successfully can still fail against a real database, and the tool does not repair or optimize SQL.
Does PocketSpry run my SQL?
No. This tool treats SQL as text and never runs the query. It uses a formatting library in your browser to reformat the source — there is no database connection, no execution, and no AI.
Frequently asked questions
- What does SQL Formatter do?
- It reformats SQL source text for readability, using the dialect and style you choose.
- Does it execute my SQL?
- No. It treats SQL as text and never runs the query.
- Does it validate SQL?
- No. Formatting is not database validation — a query that formats can still fail on a real database.
- Which SQL dialects are supported?
- Standard SQL, PostgreSQL, MySQL, SQL Server, SQLite, BigQuery, and Snowflake.
- Can it format multiple statements?
- Yes. Statements separated by semicolons are each formatted and kept.
- Does it preserve comments?
- Yes. Line (--) and block (/* */) comment contents are preserved.
- Does it change text inside string literals?
- No. String literal contents are preserved; keyword casing applies only to SQL keywords.
- Can I choose uppercase or lowercase keywords?
- Yes, and you can also preserve your existing keyword case.
- Does it optimize SQL?
- No. It only reformats; it does not rewrite queries for performance.
- Does it fix broken SQL?
- No. If the SQL cannot be formatted under the selected dialect, it reports a formatting error rather than repairing it.
- Does it upload my query?
- No. This formatter runs entirely in your browser.