Developer tools

SQL Formatter and Beautifier

Free, no sign-up, works in your browser. Format messy SQL into clean, indented queries, or minify it onto one line. Works with standard SQL, PostgreSQL, MySQL, SQL Server, Oracle, BigQuery, Snowflake and more.

Keywords
Indent

Formatting changes only spacing and letter case, never what the query does. Your SQL stays on your device.

How to use the SQL Formatter

  1. Paste your SQL or open a .sql file.
  2. Pick the dialect, keyword case and indent.
  3. Click Format, then copy or download the result.

Frequently asked questions

Does formatting change what my query does?
No. Only spacing, line breaks and the letter case of keywords change.
Which databases are supported?
Standard SQL plus PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle PL/SQL, BigQuery, Snowflake, Redshift, Spark, DuckDB, Trino and ClickHouse.
Why does it say it couldn't read my SQL?
Usually a missing bracket or quote, or syntax from a different database. Try choosing the dialect your query was written for.
Is my SQL uploaded?
No. Your SQL is formatted on your device.
Is the SQL Formatter free?
Yes. It's free to use, with no sign-up and nothing to install.