How to Copy a Table from a Website into Excel or CSV
By the DataSwitch Pro team · · 4 min read
Quick answer
For a small, simple table, select it in the browser, copy, and paste into Excel (use Paste Special → Text to drop formatting). For a table you will refresh, use Excel's Data → From Web with the page URL, or Google Sheets' =IMPORTHTML("URL", "table", 1). When copy and paste produces broken columns, copy the table's HTML from the browser's Inspect panel and convert it with an HTML Table to CSV converter.
Price lists, statistics, sports results, comparison charts — the web is full of tables you might want to sort, filter or chart. Getting them into a spreadsheet cleanly depends on how the page is built.
Method 1: Copy and paste
- Select the table in the browser, from the first header cell to the last cell.
- Copy it (Ctrl+C or ⌘+C).
- In Excel, use Home → Paste → Paste Special → Text (or Unicode Text), or Ctrl+Shift+V in Google Sheets, to paste values without the web page's fonts and colours.
This works well for small, well-built tables. It fails when the selection grabs surrounding text, when cells contain icons or buttons, or when the “table” is built from div elements rather than a real HTML table.
Method 2: Excel's From Web import
- Go to Data → From Web and paste the page URL.
- The Navigator lists every table Power Query found. Pick the right one using the preview.
- Click Load, or Transform Data to remove columns or fix types first.
The import can be refreshed later, which is ideal for pages that update regularly. It cannot see pages that require a login, and tables loaded by JavaScript after the page opens may not appear.
Method 3: Google Sheets IMPORTHTML
Google Sheets formula
=IMPORTHTML("https://example.com/prices", "table", 1)
The last number is the position of the table on the page (1 for the first). Google refreshes the result periodically. Like Excel's import, it only sees tables present in the page's HTML, not ones drawn later by scripts.
Method 4: Convert the table's HTML
When the first three methods produce shifted columns or miss the table, go to the source:
- Right-click inside the table and choose Inspect.
- In the Elements panel, find the
<table>element (hover to highlight it on the page), right-click it and choose Copy → Copy outerHTML. - Paste it into the HTML Table to CSV converter. Header cells become the CSV header; links and formatting are reduced to their text.
- Open the CSV in Excel, or turn it into a workbook with CSV to Excel.
Because you copy what the browser actually rendered, this also works for tables that were built by JavaScript or that sit behind a login you are already signed into.
Cleaning up common problems
- Merged cells (
colspan,rowspan) shift values into the wrong columns. Fix the affected rows by hand, or unmerge by repeating the value. - Numbers stored as text, for example “1,299.00 €”. Remove currency symbols and thousands separators with Find & Replace, then convert the column to numbers.
- Footnote markers such as “1,250[3]” — remove the brackets with Find & Replace using a wildcard:
[*]. - Several header rows: keep one row of column names for sorting and filtering to work.
- Hidden text (screen-reader labels, sort arrows) can appear in cells; delete it in the converted file.
Respect the source
Check the website's terms before reusing data, credit the source when you publish it, and prefer an official download or API when one exists — it is usually more complete and more up to date than a scraped table.
Try it on your own file. Free, private, and processed in your browser.
Frequently asked questions
Why does my pasted table end up in one column?
The copied content was treated as plain text without cell boundaries. Try Paste Special, the From Web import, or converting the HTML.
Can I import a table that needs a login?
Excel and Google Sheets imports cannot sign in. Copy the table's HTML from your logged-in browser and convert it instead.
How do I get a table from a PDF?
PDFs are not HTML. Use Excel's Data → Get Data → From File → From PDF (Microsoft 365 on Windows) or a PDF table extraction tool.
Can I turn the table into Markdown or JSON?
Yes. Convert the HTML to CSV first, then use CSV to Markdown or CSV to JSON.