Santekno/tools

SQL Formatter

Pretty-print SQL queries with dialect-aware indentation. Supports PostgreSQL, MySQL, SQLite, BigQuery, MariaDB, and T-SQL.

Processed in your browserUpdated · Jan 2026
Input
0 charsindent
Output
0 chars

How to use SQL Formatter

Paste your input on the left, choose the options you want, and the output appears instantly on the right. Everything runs in your browser — none of your data is sent to a server.

  • Paste or type your input in the INPUT panel
  • The output regenerates automatically as you type
  • Use Copy to put the result in your clipboard
  • Click Sample to load a working example

What is SQL Formatter?

SQL Formatter takes any SQL query and reformats it for readability — consistent indentation, uppercase keywords, and proper line breaks for clauses. Each dialect (PostgreSQL, MySQL, SQLite, BigQuery, MariaDB, T-SQL, generic SQL) has subtle differences in parsing; pick the one matching your database for the most accurate output. All processing is local — your queries never leave the browser. This tool is part of santekno's developer toolbox — a curated collection of utilities built for engineers who care about speed, privacy, and simplicity.

Common use cases

  • Debugging API payloads and integration issues
  • Inspecting tokens, hashes, or encoded strings during development
  • Generating fixtures and sample data for tests
  • Sharing readable output with teammates in code reviews

FAQ

Match the one your database uses (PostgreSQL for Supabase/Neon, MySQL for MariaDB-compatible servers, SQLite for embedded, BigQuery for GCP). When unsure, the generic `sql` dialect is a safe fallback.

No. The tool only reformats text — nothing is connected to any database.

It is the most common SQL style convention. Disable via the UPPER toggle if you prefer lowercase.

Yes. Both `--` line comments and `/* */` block comments are kept in place.

The formatter does best-effort parsing — minor errors usually still produce readable output. Severe errors show a message.