Quick answer: For a small table, select it on the page, copy, and paste into Google Sheets; if it lands in one column, use Data → Split text to columns. For a public page you want to refresh, use =IMPORTHTML("URL", "table", 1) and change the last number until the right table appears. If the table is rendered by JavaScript or sits behind a login, export it to CSV with a browser tool and import that file.
You can see the table on the page. You want it in Google Sheets — once, or as a formula that updates later. A direct copy and paste is often enough. Other times the paste lands in one column, the page’s colors and fonts come along, or IMPORTHTML comes back #N/A.
The methods below start with no extra tools. Move down only when the previous one fails. If you need the same table in Excel or as a CSV file instead, see How to export an HTML table to Excel or CSV.
Copy the table and paste it into a sheet
For a small, ordinary HTML table, this is still the fastest path.
- Click just before the first cell and drag to the last cell. Avoid grabbing the site header or a sidebar.
- Copy it (
Ctrl+Con Windows,Cmd+Con a Mac). - In Google Sheets, click the cell that should hold the top-left corner of the table and paste (
Ctrl+V/Cmd+V).
If the grid and the numbers look right, you are done. Rename the spreadsheet, or use File → Download if you also need an Excel workbook or a CSV.
When the result looks wrong, do not retype the table:
- The page’s fonts, colors, or links come along. After a normal paste, select the range and use Format → Clear formatting. Paste special in Sheets is meant for copying cells *inside the same spreadsheet*. It does not reliably clean a table you just copied from a website. If you need a plain-text intermediate step, paste the table into a text editor first, copy it again, and paste into the sheet.
- Everything lands in one column. The clipboard may have arrived as plain text rather than a grid. Select that column, open Data → Split text to columns, and choose the separator — or Detect automatically, as described in Google’s help. After a paste, Sheets may also offer Paste → Split text to columns.
- You only got the rows that were on screen. Many dashboards render just the visible slice of a long grid. If new rows replace the old ones as you scroll, copy-paste cannot see the rest.
- The “table” is not a real
<table>. Some pages lay out a grid with<div>s. A paste may collapse or scramble. Skip to a converter or an extension that can read the rendered page.
Copy-paste is a snapshot: if the page changes, you copy it again.
Use IMPORTHTML for a public page that already has an HTML table
If the table lives on a public URL and you may want a fresh copy later, Google Sheets can fetch it with IMPORTHTML:
=IMPORTHTML("https://example.com/page", "table", 1)
The first argument is the full page address, including https://. The second is "table" (use "list" for a bulleted or numbered list). The third is the index: 1 is the first table in the HTML source, 2 the second, and so on. Lists and tables are numbered separately, so a page can have both a table 1 and a list 1.
You can also keep the address and index in cells, which makes it easier to try another table without rewriting the formula:
=IMPORTHTML(A2, "table", B2)
The first time a spreadsheet uses an import formula, Sheets may show a warning that the sheet will send and receive data from external parties. An editor has to click Allow access. Until someone does, the imports on that sheet stay blocked. Google’s import-function help notes that this prompt may ask for a desktop browser; on a phone, request the desktop site first, then allow access.
Find the right table index
Navigation boxes, footers, and hidden layout tables all count, even when you barely see them. The table on screen may not be number 1.
The careful way is to use View page source (not Inspect) and search for <table. Each match is one index, in order. Use the page source because Inspect also shows tables that JavaScript added after the page loaded, and IMPORTHTML never sees those. The quick way is to try 1, then 2, then 3, until the preview matches.
If the page later inserts a table above yours, the same formula can start returning a different grid, without an error. Check the index again when the site changes.
Keep only some columns, then decide if it should stay live
IMPORTHTML returns the whole table. To keep a subset, wrap it in QUERY. Imported columns are called Col1, Col2, and so on. The last 1 tells QUERY that the first row is a header:
=QUERY(IMPORTHTML("https://example.com/page", "table", 1), "select Col1, Col2, Col3", 1)
Google’s documentation says IMPORTHTML checks for updates every hour while the spreadsheet is open, even if you do not edit the formula. Opening the file or refreshing the browser tab does *not* force a refresh. Deleting the formula and entering it again does.
That live link is useful for a public ranking or a page that changes during the day. For a fixed copy, select the imported range, copy it, and use Edit → Paste special → Values only on another sheet or a free range in the *same* spreadsheet. The values stay; the formula is gone, and later refreshes will not overwrite your snapshot. Cleanup steps such as Edit → Find and replace or Data → Data cleanup → Trim whitespace also belong on that values-only copy, because they change cell contents, not what a live formula returns.
What to do when IMPORTHTML returns #N/A or the wrong table
The request comes from Google’s servers, not from your browser. The formula only sees the HTML the server sends. It does not run the page’s JavaScript, and it cannot use your login cookie.
| What you see | Usual cause | What to try |
|---|---|---|
| The wrong block of cells, but no error | The index points at a different <table> in the source | Raise or lower the index; confirm the order in View page source |
#N/A and “imported content is empty” | The table is not in the raw HTML — often because JavaScript builds it — or the page returned no table | Search the page source for <table. If it is missing, changing the index will not help |
#N/A and “could not fetch URL” | Google could not retrieve the page: a typo in the address, a login wall, a site that blocks automated requests, or a page that is only a shell until scripts run | Check the URL, including https://. Open the page in a private window while signed out. If it still fails, switch to a method that reads the page already in your browser |
| A message about too many import requests | The spreadsheet, or others you created, is calling IMPORTHTML, IMPORTDATA, IMPORTFEED, or IMPORTXML too often | Reduce the number of import formulas and how often their source arguments change |
| “Admin has not allowed imports from…” | A Workspace policy is blocking the URL | Ask the admin to allow that source, or paste a snapshot instead |
#ERROR! or #VALUE! in the formula cell | A typo: smart quotes instead of straight quotes, a missing comma, or an extra parenthesis | Rewrite the formula with straight "double quotes" and three arguments |
#ERROR! about NOW(), RAND(), RANDARRAY(), or RANDBETWEEN() | Import functions are not allowed to reference those volatile functions | Put a fixed URL in the formula, or paste values from a helper cell |
If View page source does not contain the table you can see on the page, IMPORTHTML cannot import it. The same limit applies to IMPORTXML, which can pull other public markup with an XPath query but still fetches from Google’s servers and still does not run scripts or log in as you.
Before you collect a site’s content this way, check that site’s terms.
Use IMPORTDATA or File → Import if the site already offers a CSV
Some public pages also publish a downloadable .csv or .tsv file. That file is usually cleaner than an HTML table. If you have a direct URL to it, IMPORTDATA can pull it in:
=IMPORTDATA("https://example.com/data.csv")
The same freshness and access rules as IMPORTHTML apply: the file must be public, the first use may need Allow access, and the formula refreshes on Google’s schedule, not when you reload the tab.
If you already have the file on your computer, use File → Import and upload it. When the import dialog offers to convert text to numbers, dates, and formulas, turn that off if the file contains IDs, ZIP codes, or other values with leading zeros. You can also set a column to Format → Number → Plain text before you paste into it. Once Sheets has already treated a value as a number, a leading zero is gone and has to be imported again from the original file.
Copy a rendered or logged-in table, then bring the file into Sheets
When IMPORTHTML or IMPORTDATA fails, stay on the page you already have open and copy the table *after* the browser has rendered it.
If you can select the table, or you already have its HTML, this site has a HTML table to CSV / Excel converter that runs in your browser: paste the copied table or the markup, preview the rows, and download CSV, TSV, or an .xlsx file. The paste never leaves your computer. Then, in Google Sheets, use File → Import on the download. This is also a good path when a direct paste into Sheets keeps the page’s styling, or when long IDs should stay as text.
If the grid is awkward to select on the page, the DevTools steps in How to export an HTML table to Excel or CSV show how to copy the rendered <table> element and either paste it or send it through the same converter.
If you export tables most days, a browser extension can read the table already on the screen, which is why it also works on JavaScript-heavy and logged-in pages. Table to Excel & CSV is the extension this site makes, and you can install it from the Chrome Web Store. It lists the tables it finds on the current page, highlights one when you hover, and can copy TSV, which pastes straight into Google Sheets, or download CSV or Excel. Work stays in the browser; the table is not uploaded. The free tier exports up to 500 rows per file, and long numbers or leading zeros are kept as text. Pro (US$9, one-time) removes the row limit; details are on the extension page. For a one-off table, the converter and the DevTools steps are enough: download the file, then import it into Sheets.
No formula, converter, or extension can invent rows the page has not rendered. If a grid only paints the visible window, you still have to work within that limit, or look for an official export.
Which method should you use?
| Situation | Start with |
|---|---|
| A short table you need once, and you can select it | Copy and paste (clear formatting or split text to columns if the paste is messy) |
| A public page whose table is in the HTML, and you want it to refresh | IMPORTHTML (wrap in QUERY if you only need some columns) |
| The same page already offers a CSV or TSV URL | IMPORTDATA, or File → Import if you have the file |
| You want a snapshot that will not change later | Copy the imported range and Paste special → Values only in the same spreadsheet |
| The table is built by JavaScript, or sits behind a login | The in-browser converter after you copy the table, DevTools, or an extension that reads the current tab — then paste, or File → Import |
Frequently asked questions
Why does a pasted table end up in one column?
Either the paste arrived as plain text, or what looks like a table on the page is a layout of <div>s. Use Data → Split text to columns. If the inspector does not show a <table>, use the converter or an extension that can read some grid layouts.
Why does IMPORTHTML find no table, or say it could not fetch the URL?
Google’s servers fetch the page and never run its JavaScript. They also cannot use your login cookie. Check View page source. If the table is missing there, switch to a tool that reads the rendered page. A blocked or login-only URL can produce “could not fetch URL” even when the page opens fine in your browser.
Does reloading the spreadsheet refresh IMPORTHTML?
No. Google’s help says the formula checks for updates every hour while the document is open. Reloading the tab does not trigger that check. To force a refresh, delete the formula and enter it again.
How do I keep a copy that will not change?
Select the imported cells, copy them, and use Edit → Paste special → Values only in the same spreadsheet. That command is the right tool here, because you are copying cells that are already in the sheet.
How do I keep long IDs and leading zeros from breaking?
Treat them as text, not numbers. Set the column to Format → Number → Plain text before you paste, or turn off text-to-number conversion when you import a CSV. If Sheets has already parsed 00123 as 123, or shown a long ID in scientific notation, format changes will not put the missing digits back; import or paste the values again as text.
Can I import a table from a page I have to sign in to?
Not with IMPORTHTML, IMPORTXML, or IMPORTDATA. Stay on the page in your browser and use copy-paste, the converter after a copy, DevTools, or an extension that reads the current tab, then bring the result into Sheets.
Is this affiliated with Google?
No. “Google Sheets” here means the Google Sheets application and its documented functions.