SQL Formatter

Format and beautify SQL with proper indentation, or minify to a single line. Dialect-aware (ANSI / MySQL / Postgres).

Enter input above to see the result.

What is this for?

SQL ranges from a one-liner you typed in psql to a 200-line analytics query that nobody can read until it's indented properly. This formatter takes any SELECT, INSERT, UPDATE, or DDL and rewrites it with consistent indentation, line breaks before each clause, and uniform keyword casing. The minify mode does the opposite — squashes everything to a single line for embedding in code or scripts. The whole thing runs in your browser; queries never leave the page.

When to use it

Common gotchas