[Go to site: main page, start]

SQL formatter

Format SQL locally for PostgreSQL, MySQL, SQLite, SQL Server, BigQuery or standard SQL. Choose indentation and keyword case, then copy or download the query.

Make the query easier to read.

Give a dense query a consistent layout before reviewing or sharing it. Select the dialect, choose spacing and keyword case, and inspect the result. The tool never executes SQL or connects to a database.

Free to use. No signup. Output: Formatted SQL + .sql download.

How to use SQL formatter

  1. Paste a query up to 100,000 characters or try the included join example.
  2. Select its SQL dialect, indentation and keyword case, then format it locally.
  3. Review the formatted query and copy or download the .sql file. Changes clear the previous result.

Worked example: Make a project feedback query readable

Formatting preserves quoted values and identifiers. It does not verify that referenced tables exist or that a query is safe or efficient.

Example input
Use the example left join between projects and feedback, with COUNT, GROUP BY and ORDER BY, in PostgreSQL mode.
Expected output
The same query laid out with two-space indentation and uppercase keywords, ready to copy or save as formatted.sql.
SQL formatter: example workspace
Example workspace. Try the editable tool above. View example at full size

Questions, answered

Which SQL dialects are available?

Choose standard SQL, PostgreSQL, MySQL, SQLite, SQL Server Transact-SQL or BigQuery. Dialect selection matters for quoting, keywords and operators. The formatter does not support stored procedures or custom statement delimiters; use a database-specific editor for those inputs.

Does a successful result mean my SQL is valid?

No. Formatting is a presentation step, not schema validation, query optimization or a security review. A query can format successfully and still fail or do something unintended in a database. Review and test queries in an appropriate environment before executing them.

Is the query uploaded or executed?

No. A local background worker formats the query and never executes SQL. You can cancel processing, and an automatic deadline stops a job that takes too long. Inputs are capped at 100,000 characters and formatted output at 1,000,000 characters.

Why is there a formatting error?

Check the selected dialect, unmatched quotes, unfinished comments and unsupported syntax. The error includes the formatter’s explanation when available. Your input stays editable so you can correct it or reset to the example.

Keep building

Ready for feedback on your project?

Share what you are building with the VibeCodingList community.