SQL Formatter & Beautifier

Format and beautify SQL queries instantly. Supports MySQL, PostgreSQL, SQLite, T-SQL, PL/SQL and more.

Examples:
Input SQL
Formatted SQL

Why Format SQL?

  • Improves readability for code reviews
  • Easier to debug complex queries
  • Consistent style across a team
  • Helps spot syntax errors quickly
  • Required for documentation and wikis

Supported Dialects

  • Standard SQL
  • MySQL
  • PostgreSQL
  • SQLite
  • T-SQL (SQL Server)
  • PL/SQL (Oracle)
  • MariaDB
  • IBM DB2
  • BigQuery
  • Apache Hive
  • Apache Spark
  • Trino

Formatting Options

  • 2, 3, 4 space or tab indentation
  • Uppercase or lowercase keywords
  • Blank lines between multiple queries
  • Clause-per-line layout (SELECT, FROM, WHERE…)
  • Download as .sql file