Free Tool

SQL Formatter & Beautifier

Format and beautify SQL queries with consistent indentation and keyword casing. Supports SELECT, INSERT, UPDATE, DELETE, CREATE, and more.

SQL Formatter & Beautifier

Indent
Keywords

What the formatter does

  • • Puts each major clause (SELECT, FROM, WHERE, JOIN…) on its own line
  • • Indents column lists under SELECT, GROUP BY, and ORDER BY
  • • Places AND / OR conditions on separate indented lines inside WHERE / HAVING / ON
  • • Merges compound keywords: LEFT OUTER JOIN, GROUP BY, ORDER BY, etc.
  • • Preserves quoted strings and comments unchanged
  • • Works with SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, and more

What the formatter does

SQL formatting adds consistent indentation and line breaks, aligns clauses (SELECT, FROM, WHERE, JOIN), and normalises keyword casing to uppercase or lowercase.

How to use

  1. Paste your SQL query.
  2. Choose keyword casing (UPPER or lower).
  3. Click Format / Beautify.
  4. Copy the formatted SQL.

Your SQL stays in your browser — nothing is sent to any server.

Frequently Asked Questions

Which SQL dialects are supported?
Standard SQL keywords (ANSI SQL). Most MySQL, PostgreSQL, and SQLite syntax is formatted correctly.