SQL Formatter

Sort SQL according to PostgreSQL·MySQL dialects. Adjust indentation and keyword case, but no query is executed.

SQL Formatter input

Up to 100,000 characters · Run with Ctrl/⌘ + Enter · Not executed in a database.

Bracket·keyword case

Input is processed in this tab and is not saved or sent. Sharing includes only a summary.

Result

Execute after input.

Share result

Share the tool link and result text together. No URL is included in the result. Check the below content and then share it.

How to use and processing criteria

A tool that organizes spaces and keywords according to SQL dialects.

Actual example

select name, count(*) as total from visits where source='newsletter' group by name; when sorted by uppercase keyword and space 2 column, the SELECT, FROM, WHERE, and GROUP BY clauses are separated by lines. The newsletter string content remains unchanged. Results are not sent to or executed in a database.

Frequently Asked Questions

Which dialect can be selected?

Standard SQL: PostgreSQL, MySQL, SQLite, SQL Server, BigQuery, MariaDB, Oracle, Spark, Snowflake are available. Select the dialect appropriate for your query. Changes to separators beyond procedures or semicolons are not supported.

Does ‘successful sorting’ mean the SQL is correct?

No. It is a blank·keyword sorting tool, not a full SQL syntax validator or execution plan analyzer. It does not indicate table existence, permissions, performance, or execution results. Review the output directly for strings, comments, and placeholders.

Save input and result?

Processes in this tab’s memory without automatic saving or transmission. Supports up to 100,000 characters input and 1,000,000 characters output. Can cancel the conversion, and even if there’s an error, the previous normal result is preserved. Results can be downloaded or copied as a SQL file.

Calculation criteria and reference materials

Verification of calculation criteria: · Calculation·verification principles · Report errors