How to copy a table from Wikipedia into Excel or Google Sheets
Expand collapsed tables and sort first, then copy the table (or use =IMPORTHTML in Google Sheets) and paste it into the spreadsheet. Remove footnote markers such as [1] from number cells: in Excel, Find and replace [*] with nothing; in Google Sheets, Find and replace \[[^\]]*\] with regular expressions on. Wikipedia text is licensed CC BY-SA, so credit the article if you republish it.
Wikipedia tables are plain HTML tables, so they copy better than most. The problems are specific: footnote markers stuck to numbers, collapsed tables, row numbers that are not really in the table, and navigation boxes that look like tables. Here is how to get a clean copy and fix what comes across.
Quick steps
- Open the article. Open the Wikipedia article in Chrome. If the table is collapsed, click show to expand it; if you want a different order, sort it by clicking a column header first.
- Pick the table. Click the Table Export icon. Data tables are listed with their size and first row; the navigation boxes at the bottom of the article are listed too, so pick by size and first row.
- Copy or save. Click Copy to put the table on the clipboard, or CSV to save it as a file.
- Paste and clean up. Paste into Excel or Google Sheets, then remove footnote markers such as [1] with Find and replace (below).
What comes across, and what does not
- Sorting: Wikipedia sorts a table by reordering its rows on the page, so a table you sorted is copied in the sorted order.
- Collapsed tables: rows hidden by a collapsed table are skipped, like any hidden row. Click show before copying.
- Row numbers: some lists draw rank numbers with the page's style sheet rather than as table cells. They are not part of the table, so they do not come across; add a numbered column in the spreadsheet if you need one.
- Footnote markers: a reference such as [1] or [a] is part of the cell text, so a population cell can arrive as 8,232,000,000[1] and be treated as text.
- Merged cells: headers and cells that span rows or columns are repeated into each position, so every row keeps the same number of columns.
Removing footnote markers
In Excel: select the columns, press Ctrl+H, type [*] in Find what, leave Replace with empty and click Replace All. In Excel the asterisk matches any text and the brackets are plain characters, so this removes each marker. In a cell with two markers and text between them, it removes everything from the first [ to the last ], so check those cells.
In Google Sheets: Edit › Find and replace, type \[[^\]]*\] in Find, leave Replace with empty, tick Search using regular expressions and click Replace all. This removes each bracketed marker on its own.
After the markers are gone, numbers with thousands separators convert to numbers. If a column stays left-aligned, use Data › Text to Columns › Finish in Excel, or Format › Number › Number in Sheets.
IMPORTHTML for tables that change
Wikipedia articles are public, so Google Sheets can usually fetch them: =IMPORTHTML("https://en.wikipedia.org/wiki/Article_name", "table", 1) imports the first table and refreshes it periodically. The number counts every table on the page from the top, including small ones, so you may need to try a few values.
The import shows the article as Google's servers fetch it, not as you see it, so your sorting and expanded sections do not apply. Use a one-time copy when you need the table exactly as it is on your screen.
Reusing Wikipedia data
Wikipedia's text, including its tables, is available under the Creative Commons Attribution-ShareAlike 4.0 license. Copying a table for your own analysis needs nothing special; if you publish the table or something built from it, credit Wikipedia with a link to the article and share it under the same license.
Want to try it first? The demo page has a plain table, one with merged cells and a long one.
FAQ
Why do my Wikipedia numbers show up as text?
Usually a footnote marker such as [1] is attached to the number. Remove the markers with Find and replace, then convert the column to numbers.
Why are rows missing from my copy?
The table was collapsed or some rows were hidden on the page. Expand the table with show, then copy again. Rows that are not visible on the page are skipped.
Does it work on Wikipedia in other languages?
Yes. Every Wikipedia language edition uses the same HTML tables. CSV files are saved as UTF-8 with a byte order mark, so non-Latin text opens correctly in Excel.
Updated 2026-10-25.