Skip to main content

SQL Formatter – Beautify MySQL & PostgreSQL Queries

Format or minify SQL online with dialect-aware indentation and keyword casing. Supports Standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, and SQL Server.

SQL Formatter

Beautify and minify SQL across PostgreSQL, MySQL, SQLite, BigQuery and more

Dialect
Indentation
Keyword case
Ready · Standard SQL

Formatted SQL will appear here

Paste or type a SQL query above to begin

What is SQL Formatter?

Transform unformatted SQL into readable code with proper indentation and dialect-aware formatting. Switch between beautify and minify modes, choose keyword casing and indentation, and download .sql output. Supports Standard (ANSI) SQL, MySQL, PostgreSQL, SQLite, BigQuery, and SQL Server (T-SQL).

  • sql
  • formatter
  • beautifier
  • mysql
  • postgresql
  • database

Features

What you get with SQL Formatter.

  • Multi-Dialect Support

    Standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, and SQL Server.

  • Smart Indentation

    Correct indentation for JOINs, subqueries, and CTEs.

  • Keyword Case Control

    Uppercase, lowercase, or leave keywords exactly as you wrote them.

How to use SQL Formatter

Follow these steps to get the best results.

  1. Paste your SQL query

    Paste a messy or minified query, uppercase or lowercase, single or multi-line.

  2. Pick a dialect

    Choose Standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, or SQL Server for dialect-aware formatting.

  3. Set indent and keyword case

    Choose 2-space, 4-space, or tab indentation, and uppercase, lowercase, or preserved keywords.

  4. Copy the formatted result

    Copy the formatted query. Only whitespace and keyword casing change — logic and values stay untouched.

Advertisement

In-feed adResponsive

Frequently asked questions

Common questions about SQL Formatter.

Never — only whitespace and letter casing are modified. Table names, column names, and values are left exactly as-is.

Comments

Share feedback, ask questions, or help others use this tool.

Join the discussion

Sign in to comment, reply, and report inappropriate content.

Advertisement

Mobile banner adResponsive