SnappTools logoSnappTools

SQL Formatter

Format SQL queries with proper indentation and keyword uppercasing.

SQL Input
Formatted Output

About SQL Formatter

The SQL Formatter takes messy, minified, or hard-to-read SQL queries and reformats them with proper indentation, uppercase keywords, and clean line breaks. Well-formatted SQL is dramatically easier to read, debug, and share with colleagues.

Paste any SELECT, INSERT, UPDATE, DELETE, or CREATE statement and see it formatted with keywords on their own lines, clauses indented correctly, and JOIN conditions clearly separated. The formatter supports standard SQL as well as common dialects including PostgreSQL, MySQL, and SQLite syntax.

Essential for developers working with raw SQL queries, reviewing query plans, or documenting database operations.

Features

  • Formats SELECT, INSERT, UPDATE, DELETE, and DDL statements
  • Uppercase keyword formatting
  • Consistent indentation for nested subqueries
  • JOIN and WHERE clause alignment
  • Works with PostgreSQL, MySQL, SQLite, and standard SQL

Common Use Cases

  • Formatting ORM-generated queries for readability
  • Cleaning up SQL from legacy codebases
  • Preparing queries for documentation or code review
  • Making long queries readable before optimization