· CSV.ink Team

Copy an HTML Table to CSV or Excel

Browser “Copy” often pastes a table as TSV into Excel. When that fails — merged cells, messy markup — convert the HTML table to CSV instead.

Docs sites, admin panels and reports still ship data as HTML tables. You want that grid in a spreadsheet without retyping. Sometimes Copy → Paste into Excel is enough. Sometimes it is not.

Try the simple path first

  1. Select the table in the browser (or the cells you need).
  2. Copy, then paste into Excel or Google Sheets.

Many browsers put tab-separated text on the clipboard, which spreadsheets accept. If columns line up, you are done. Save as CSV only if another system needs the file.

When paste mangles the table

  • Merged cells (colspan / rowspan) paste as shifted columns.
  • Tables generated by React-like UIs may not select as a real <table>.
  • Hidden columns or responsive layouts copy only what is on screen.

In those cases, grab the HTML (View Source, Inspect → Copy outerHTML, or “Save as” and extract the table) and run it through an HTML → CSV converter that expands rowspans and colspans into a grid.

HTML table to CSV →

Multiple tables on one page

A page can contain several <table> elements — pricing, specs, footnotes. Converters that emit one CSV per table save you from manually splitting a dump. Name files after the section so you remember which grid is which.

After you have CSV

Open in Excel for formatting, or keep CSV for import. If the page had encoding issues in the HTML, fix those in the text file before you trust totals.

CSV to Excel →

Only extract tables you have the right to reuse. Scraping personal data or copyrighted datasets can violate site terms and privacy law.

Cleaning the CSV after extraction

HTML tables frequently include footnote markers, units in the same cell as numbers (“12 kg”), and header rows repeated every screenful. Delete junk rows, split unit columns if you need numeric sorts, and normalize decimal commas if the page used a European locale.

For one-off research this cleanup in a spreadsheet is enough. For a recurring scrape, fix the extractor or the page export rather than hand-editing every week.

Outils associés

← Tous les articles

Autres articles