SQL Formatter

Format SQL queries for PostgreSQL, MySQL, SQLite, or standard SQL. Paste a query, choose its dialect, and copy the indented result.

About SQL Formatter

Format a query from a log or an ORM so you can trace its joins and filters. The formatter applies consistent indentation and line breaks while preserving quoted values and comments.

How to use SQL Formatter

  1. Enter a query

    Paste one or more SQL statements or load the example.

  2. Select the database dialect

    Choose the dialect your database uses so the formatter can recognize its quoting and parameter syntax.

  3. Format and copy

    Select Format SQL, review the output, and copy it to your editor.

Frequently asked questions