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
- Numeric types: In
.xlsx,$1,249.50and18.4%can be stored as real numeric cells (<c t="n">), while leading-zero IDs like00419stay text so Excel doesn't strip the zeros. - Multi-sheet workbooks: If a page has 4 tables (e.g., income statement, balance sheet, cash flow, ratios), one
.xlsxworkbook keeps them on separate sheets. - Paginated tables: Many SaaS dashboards show 25 rows per page; appending pages into one combined export saves manual merging.
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:
- TableXL on Chrome Web Store: https://chromewebstore.google.com/detail/kbjmhlnejlijapmiapkfdhdicjpihjpd
- TableXL on Microsoft Edge Add-ons: https://microsoftedge.microsoft.com/addons/detail/fakdhekhaknglkkemikpheiggphaemhl
- TableXL on Firefox Add-ons: https://addons.mozilla.org/firefox/addon/tablexl-table-pdf-to-excel/
- Full details & online PDF-to-Excel: https://radarbg.com/tablexl?ref=guide
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.