Skip to content
LovTools
EN

SQL Formatter

Format SQL queries for MySQL, PostgreSQL, SQL Server, SQLite and more.

Processed locally on your device — nothing is uploaded.

About the SQL Formatter

Long queries copied from logs or ORMs are hard to review on one line. The SQL formatter breaks them into clauses — SELECT, FROM, JOIN, WHERE, GROUP BY — with consistent indentation and keyword case, so joins and conditions are easy to follow.

Pick your database dialect so vendor-specific syntax such as backticks, :: casts or TOP is recognised correctly.

How to use the SQL Formatter

  1. Paste one or more SQL statements.
  2. Choose the dialect, keyword case and indentation.
  3. Press Convert and copy or download.

Features

  • Seven SQL dialects
  • UPPER, lower or preserved keywords
  • Multiple statements
  • Powered by sql-formatter

Supported formats

  • SQL
  • .sql

Frequently asked questions

Is my code uploaded?

No. Formatting and minifying run in your browser, so proprietary code and secrets never leave your device.

Does it run or validate my query?

No. It only reformats text. Nothing is executed against any database.

Added · Last reviewed · Maintained by Sohail Khax · How we test tools