Skip to content
SnapTools

SQL Formatter

Runs in your browser

Format and beautify SQL queries with consistent indentation and uppercase keywords, across common dialects.

About this tool

A SQL query pasted from a log, an ORM's debug output, or a colleague's Slack message is usually one long line with no visual structure — hard to review, harder to spot a bug in. This tool reformats it with consistent indentation, line breaks around clauses, and uppercase keywords, matching the conventions most SQL style guides converge on.

How to use

  1. Paste your SQL query.
  2. Choose the dialect if you're using dialect-specific syntax.
  3. Run to get a formatted, readable version.

When to use this tool

  • Cleaning up a query copied from an ORM's debug log.
  • Formatting SQL before a code review.
  • Making a long, unformatted query readable before editing it.

Tips

  • Standard SQL formatting works fine for most queries — only switch dialect if you're using syntax specific to one database.
  • Formatting doesn't validate the query runs correctly — it only restructures the text.

FAQ

Does this check my query is valid?
No. It formats the SQL text; it doesn't connect to a database or validate the query will execute.
Is my query sent anywhere?
No. Formatting runs entirely in your browser.