Skip to content
DevKOM

SQL Formatter

Make long SQL queries readable. Pick your database dialect, keyword case and indentation, or collapse a query onto one line. Formatting is powered by the open-source sql-formatter library and runs on your device.

Mode
Keywords
Indentation
Formatted SQL

How to format SQL

  1. Paste one or more SQL statements into the input.
  2. Select the SQL dialect that matches your database.
  3. Choose keyword case (UPPER, lower or preserve) and indentation.
  4. Copy the formatted query, or switch to Minify for a single line.

Frequently asked questions

Which SQL dialects are supported?

Standard SQL, MySQL, MariaDB, PostgreSQL, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift, Spark, DB2, Hive, Trino and more, as supported by sql-formatter.

Does it check whether my query is correct?

It only reports errors it hits while parsing for formatting. It does not run your query or check table and column names.

What does SQL minify do?

It removes comments and collapses whitespace outside string literals and quoted identifiers, producing a single-line query.

More in Code & Data.