SQL Formatter & Beautifier

Format, beautify, and indent raw SQL queries instantly. Supports SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, JOINs, subqueries, and CTEs.

Used 837 times

Keywords
Indent
SQL Input
Formatted Output

Auto-formats on paste  ·  Ctrl+Enter to format

What This Formatter Handles

Supported statements

  • SELECT with JOINs, subqueries, window functions
  • INSERT INTO … VALUES / SELECT
  • UPDATE … SET … WHERE
  • DELETE FROM … WHERE
  • CREATE TABLE / ALTER TABLE
  • WITH (CTEs) … AS

Formatting rules

  • Major clauses on new lines (FROM, WHERE, JOIN, GROUP BY…)
  • Consistent indentation for nested conditions
  • Normalised keyword casing (UPPER or lower)
  • Comma-first column formatting for long SELECT lists
  • AND / OR on new lines within WHERE clauses

Compatible with

  • MySQL 8+ / MariaDB
  • PostgreSQL 17
  • SQLite 3
  • SQL Server (T-SQL)
  • Oracle SQL (standard clauses)