toolfora
Home / Database / SQL Formatter & Explainer

SQL Formatter & Explainer

Beautify and explain any SQL query in your browser. Format with proper indentation and uppercase keywords, switch between MySQL / PostgreSQL / SQLite / Oracle dialects, get syntax-highlighted output, an AST-based plain-language explanation, and a visual execution plan preview. Everything runs locally.

Paste SQL and click Format & Explain.

How to use the SQL Formatter & Explainer

Paste any SQL statement and the tool beautifies it with consistent indentation and uppercase keywords, highlights it as syntax-colored HTML, then breaks it down into a plain-language explanation derived from the AST. It also previews a logical execution plan. All parsing and formatting happen locally in your browser.

Steps

  • Choose the dialect — MySQL, PostgreSQL, SQLite or Oracle — so the parser and formatter apply the right syntax rules.
  • Pick the keyword case (uppercase, lowercase or preserve) and the tab width for indentation.
  • Paste or type your SQL and click Format & Explain.

What you get

  • Formatted SQL — re-indented, keyword-cased, and rendered with syntax highlighting (keywords, strings, numbers, comments).
  • Plain-language explanation — the tables read, columns selected, joins, filters, grouping, ordering and limits, summarised from the parsed AST.
  • Execution plan preview — a visual flow of the likely logical steps (scan, join, filter, sort, limit). This is an in-browser estimate, not a real database plan.

Great for cleaning up messy generated SQL, teaching, or reviewing a query before you run it.