💙 Supporting healthcare non-profits: Metadataloop is free for 6–12 months. Contact Us to get started.
Developer Utility

SQL Formatter

Paste any SQL — format with consistent indentation, keyword casing, and spacing. Nothing is stored.

Input · Raw SQL
Output · Formatted
Formatted SQL will appear here.

Clean, consistent SQL formatting in one click

Inconsistent indentation and keyword casing make SQL hard to review. Paste any query or script and get instantly reformatted output with configurable keyword casing and indentation — ready to paste into a PR, a notebook, or documentation.

Formatting options

  • Keyword case: UPPER, lower, Capitalize, or preserve exactly what you typed.
  • Indentation: configurable indent width for nested clauses and subqueries.
  • Dialect-agnostic: works across PostgreSQL, MySQL, Snowflake, and T-SQL syntax.

Common use cases

Code review prep

Clean up a messy query before opening a pull request.

Documentation & tutorials

Produce consistently formatted SQL snippets for docs or blog posts.

Standardizing team style

Apply one keyword-case convention across a whole team's SQL.

Debugging dense queries

Reformat a single-line query dump into readable, indented SQL.

FAQ

Which SQL dialects does the formatter support? It formats standard SQL syntax used by PostgreSQL, MySQL, Snowflake, and T-SQL. Dialect-specific keywords are preserved as-is.

Can I control keyword casing? Yes — choose UPPER, lower, Capitalize, or preserve the casing you already typed.

Is my SQL uploaded or stored? No — formatting happens for the request only; nothing is logged or saved.

Can I download the formatted SQL? Yes — use the Download .sql button to save the formatted output directly.

⚠ Confirm Delete