Text and developer tools

SQL Formatter

Format or minify SQL in your dialect.

0 characters

Your text stays on your deviceHow?

Output
Keywords

How to format SQL

  1. Paste your SQL into the box.
  2. Choose your database, Format or Minify, the indent and the keyword case.
  3. Copy the formatted SQL.

Questions

Which databases does it know?

Standard SQL, PostgreSQL, MySQL, MariaDB, SQL Server (T-SQL), SQLite, Oracle PL/SQL, BigQuery, Snowflake, Redshift and more. Choose yours so its own syntax is read correctly.

Does formatting change what my query does?

No. Only spaces, line breaks and, if you choose, the case of keywords change. Names and strings stay exactly as written.

What does Minify do?

It puts the query on one line and removes comments, keeping every word and symbol. Comments that start with /*! or /*+, which some databases read as hints, are kept.

Why can it not format my query?

The formatter has to read the query first. Check that the right database is chosen, and that quotes and brackets are closed.

Is my SQL sent anywhere?

No. It is formatted inside your browser, so table names and data never leave your device.