Radar

Home › Guides

How to Export Any HTML Table or ARIA Grid to Excel Without Broken Numbers

2026-11-30

Copy-pasting web tables into Excel almost always breaks something: currency strings like $1,249.50 or €98.50 paste as text (so =SUM() returns 0), percentages lose their numeric value, and modern React/SaaS dashboards built with role="grid" instead of <table> don't paste into columns at all.

Here is how to extract both HTML tables and ARIA grids cleanly—first with a standalone browser console snippet, and then with a 1-click extension.

Option 1: Extract HTML Tables + ARIA Grids with Plain JavaScript

Paste this into DevTools Console on any page to download the largest visible table (or ARIA grid) as a UTF-8 CSV with numeric values cleaned for Excel:

(() => {
  const cleanCell = (el) => (el.innerText || el.textContent || "").replace(/\s+/g, " ").trim();

  const parseHtmlTable = (tbl) =>
    Array.from(tbl.querySelectorAll("tr"))
      .filter((tr) => tr.closest("table") === tbl)
      .map((tr) => Array.from(tr.children).filter((c) => c.tagName === "TH" || c.tagName === "TD").map(cleanCell))
      .filter((r) => r.some(Boolean));

  const parseAriaGrid = (grid) =>
    Array.from(grid.querySelectorAll('[role="row"]'))
      .map((r) => Array.from(r.querySelectorAll('[role="columnheader"],[role="rowheader"],[role="gridcell"],[role="cell"]')).map(cleanCell))
      .filter((r) => r.some(Boolean));

  const candidates = [
    ...Array.from(document.querySelectorAll("table")).map((el) => ({ rows: parseHtmlTable(el) })),
    ...Array.from(document.querySelectorAll('[role="table"],[role="grid"]')).filter((el) => el.tagName !== "TABLE").map((el) => ({ rows: parseAriaGrid(el) })),
  ].filter((c) => c.rows.length >= 2);

  candidates.sort((a, b) => b.rows.length * b.rows[0].length - a.rows.length * a.rows[0].length);
  if (!candidates.length) return console.log("No tables found.");

  const esc = (v) => (/[",
]/.test(v) ? `"${v.replace(/"/g, '""')}"` : v);
  const csv = "" + candidates[0].rows.map((r) => r.map(esc).join(",")).join("
");
  const a = document.createElement("a");
  a.href = URL.createObjectURL(new Blob([csv], { type: "text/csv;charset=utf-8" }));
  a.download = `${location.host}-table.csv`;
  a.click();
})();

Why real .xlsx beats CSV for finance and analytics tables

Option 2: 1-Click Export in Chrome, Edge, or Firefox (TableXL)

We packaged all of this—HTML tables, ARIA grids, smart currency/number parsing, right-click "Copy for Google Sheets", multi-page append, and direct PDF/bank statement to Excel tools—into TableXL, running 100% locally in your browser:

Free exports up to 50 rows per table with no sign-up; unlimited rows and multi-sheet workbooks unlock with a one-time €4.99 Radar Pass (30 days, never auto-renews).

Disclosure: This guide was written with AI assistance by the RadarBG team, and TableXL is our own product. If anything breaks on a site you use, tell us at radarbg.com/support and we fix it.

More guides

EN