πŸ—„οΈ

SQL Formatter

Format & beautify SQL queries with syntax highlighting. Supports Standard SQL, MySQL, PostgreSQL, T-SQL, and BigQuery.

Dialect:
Indent:
Case:
Input SQL
Formatted Output

      

About SQL Formatter & Beautifier

The SQL Formatter & Beautifier takes raw, compressed, or hand-written SQL queries and reformats them with consistent indentation, line breaks at clause boundaries, and optional keyword casing. It supports five dialects β€” Standard SQL, PostgreSQL, MySQL, T-SQL (SQL Server), and BigQuery β€” so dialect-specific syntax is handled correctly.

Readable SQL is easier to review, debug, and maintain. Because formatting runs entirely in your browser using the open-source sql-formatter library, none of your queries or schema names leave your machine.

Common Use Cases

How to Use

  1. Select your SQL dialect (Standard SQL, PostgreSQL, MySQL, T-SQL, or BigQuery)
  2. Paste your query into the Input panel β€” formatting runs automatically as you type
  3. Adjust indent width (2 spaces, 4 spaces, or tabs) and keyword case (UPPERCASE / lowercase / Preserve)
  4. Click Copy to copy the formatted output, or Minify to collapse it to a single line

Frequently Asked Questions

Which SQL dialects are supported?

The formatter supports Standard SQL, PostgreSQL, MySQL, T-SQL (Microsoft SQL Server / Azure SQL), and Google BigQuery. Each dialect handles specific syntax differences like ILIKE, TOP, backtick identifiers, and window function extensions.

Will this tool execute my SQL query?

No. The formatter only parses and reformats the text of your query. It does not connect to any database, execute statements, or validate table or column names against a real schema.

Can I format multiple statements at once?

Yes. Paste multiple SQL statements separated by semicolons and the formatter will process all of them, inserting proper line breaks and indentation between each statement.

Advertisement