← Tools

SQL Formatter

Make SQL readable, in the keyword style you like, or squeeze it onto one line.

Private: your files never leave your device.

How it works

  1. Choose your files.
  2. Adjust the settings if you like.
  3. Download the result, or send it to another device with BroAllDone.

Frequently asked questions

How do I format SQL?

Paste your query or open a .sql file, choose your SQL dialect, then tap Format SQL. Clauses go on their own lines and keywords get the case you choose.

Which databases are supported?

MySQL, MariaDB, PostgreSQL, SQL Server (T-SQL), Oracle PL/SQL, SQLite, BigQuery, Snowflake, Amazon Redshift, Spark, Hive, Trino, DuckDB, ClickHouse, Db2 and more. Choosing the right one makes sure its special syntax is understood.

Can it put SQL on one line?

Yes. Tap Compact to remove line breaks, extra spaces and comments. Text in quotes, quoted names, optimizer hints like /*+ … */ and lines such as GO or DELIMITER are kept, so the script still runs.

Will formatting change my query?

No. Only spaces, line breaks and, if you choose, the case of keywords change. Your values, names and strings stay exactly as they were.

Why does it show a syntax error?

The query couldn't be read in the chosen dialect, often because of a missing bracket or quote. The line and column are shown, and Show me jumps there. Check that the right dialect is chosen too.

Is my SQL uploaded?

No. Everything happens in your browser, so your queries never leave your device.

More free tools