Code · Made a little simpler

SQL Formatter

Format SQL locally for SQLite, PostgreSQL, MySQL and other dialects. Set indentation and keyword case, inspect the output and download the formatted query.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

SQL Formatter: how to use it

  1. Choose the SQL dialect, indentation and keyword case.
  2. Paste a query or select a local UTF-8 file. Select Format SQL.
  3. Review the output and download formatted.sql. Check the quoted identifiers, string literals and binding placeholders.

Limits and notes

Accepts 250,000 UTF-16 code units and UTF-8 files up to 4 MiB. Layout follows SQL Formatter’s supported syntax. Formatting does not connect to a database or validate a schema.

How your privacy works →

SQL Formatter: common questions

Why select a SQL dialect?

Dialects have different quotes, operators and placeholders. PostgreSQL dollar-quoted literals and MySQL backtick identifiers are interpreted using the chosen grammar.

Does formatting replace my bound parameters?

Placeholders recognized by the selected dialect remain in the output. The tool has no binding values or database connection.

Guides