Skip to content
100% local

SQL EXPLAIN plan formatter

Turn a pasted EXPLAIN or EXPLAIN ANALYZE plan into a readable, indented tree with the slow parts flagged.

Input
Output

SQL EXPLAIN plan formatter

Paste the raw output of EXPLAIN or EXPLAIN ANALYZE and this tool turns the wall of text into an indented tree of operations, with each node's cost, row counts and timing lined up next to it. Instead of scanning a dense block of "cost=… rows=… actual time=…" annotations, you get a shape you can read at a glance — which scan feeds which join, and where the query actually spends its time.

Pick the dialect that matches your database: PostgreSQL and MySQL's EXPLAIN ANALYZE both use the same indented "-> " tree, MySQL's classic (non-ANALYZE) EXPLAIN table is parsed row by row, and SQLite's EXPLAIN QUERY PLAN gets its own ASCII-tree and id/parent formats. Paste plain text or switch input format to JSON for PostgreSQL's EXPLAIN (FORMAT JSON) and MySQL's EXPLAIN FORMAT=JSON output. Show row counts toggles the estimated-versus-actual row figures, the expensive-node threshold controls what percentage of the total cost or time earns a node the "expensive" flag, and hide nodes below lets you prune low-cost branches out of a long plan so the outliers stand out. Switch output between an indented tree and a plain aligned table.

The cost and time each node reports are cumulative — they already include every child underneath — so the tool subtracts each node's children before ranking anything, which is what stops a query's top-level node from always looking like the "expensive" one. The summary line under the plan totals the operations, counts how many were flagged, and names the slowest branch from root to leaf so you know exactly which chain of operations to investigate first.

Everything runs locally in your browser — a query plan can reveal table and index names you'd rather not paste into a random web form, and none of it is uploaded anywhere. Copy the formatted tree, download it as a .txt file, or send the output back into the input to adjust the threshold and reformat.

FAQ

Which EXPLAIN formats does it understand?
PostgreSQL and MySQL 8's EXPLAIN ANALYZE tree output, MySQL's classic tabular EXPLAIN, SQLite's EXPLAIN QUERY PLAN (both its ASCII-tree and raw id/parent/detail rows), plus PostgreSQL's and MySQL's JSON plan formats.
Why is the top-level node not always flagged as expensive?
A node's reported cost and time already include everything beneath it, so the tool compares each node's own share after subtracting its children — that's what points at the actual bottleneck instead of always highlighting the root.
What happens if SQLite's plan has no cost data?
SQLite's EXPLAIN QUERY PLAN doesn't report cost or timing, so the tree still formats and the summary says so honestly instead of guessing at a highlight.
Does "hide nodes below" delete anything from my plan?
No — it only omits low-share rows from this view. The root operation always stays visible so the tree keeps its anchor; re-run with a lower threshold to see everything again.
Is my query plan uploaded anywhere?
No. Parsing and formatting happen entirely in your browser — the plan, and any table or index names in it, never leave your device.