SQL Formatter

Beautify long, single-line queries with this free SQL formatter. Choose MySQL, PostgreSQL, T-SQL, PL/SQL, or standard SQL, set indent width and keyword case, then pretty-print for readable code reviews. Minify when you need a compact string for logging.

Formatting happens entirely in the browser - useful when queries contain customer filters or internal table names you should not paste into upload-based tools. Pair with CSV to JSON when moving tabular exports into application code.

Input
Paste or type your content here…
Output
Your result will appear here

Frequently Asked Questions

Which SQL dialects are supported?
Standard SQL, MySQL, PostgreSQL, T-SQL, and PL/SQL via the dialect dropdown. Pick the closest match for keyword and function formatting.
Does formatting change query meaning?
No - only whitespace and keyword casing change. Always run critical queries in a staging environment after edits.
Can I minify SQL?
Yes. Minify collapses the beautified form into a compact single-line string for logs or embeds.
Why did formatting fail on my query?
Unusual vendor syntax or incomplete statements can confuse the parser. Try Standard SQL dialect or simplify CTEs/hints and retry.