Skip to content
kitify
Esc
↑ ↓ to moveEnter to open

SQL formatter

Paste a one-line query from your logs or ORM and get it back indented and readable, in the dialect you use.

How to format SQL

  1. Paste one or more queries. Separate them with semicolons.
  2. Choose your dialect so special syntax is understood, such as backticks in MySQL, :: casts in PostgreSQL or square brackets in SQL Server.
  3. Pick UPPERCASE, lowercase or as-typed keywords and 2 or 4 space indents. Copy the result.

Why readable SQL matters

Queries copied from ORM logs or slow-query reports arrive on a single line. Putting each clause (SELECT, FROM, JOIN, WHERE, GROUP BY) on its own line makes it easier to spot a missing join condition or an accidental cross join, and makes code review diffs cleaner.

Real queries often contain customer data in their WHERE clauses. This formatter runs entirely in your browser, so nothing you paste is sent anywhere.

Questions people ask

Which SQL dialects are supported?

Standard SQL, MySQL, MariaDB, PostgreSQL, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift and Spark SQL.

Does it change what my query does?

No. Only whitespace and, if you choose, keyword capitals change. Identifiers and string values are left exactly as they are.

Can it minify SQL?

Yes. Tick Minify to one line to strip comments and spare whitespace, which is handy for embedding a query in code.