What is IMPORTHTML in Google Sheets?

IMPORTHTML fetches a public web page and returns a table or list from its HTML. You provide the URL, the query type (table or list), and the index of which table or list on the page to import. It is a quick scraper for simple pages without writing Apps Script.

When to use it

Use IMPORTHTML when a site publishes data in a plain HTML table or list and you want a live snapshot in a sheet for light monitoring or research.

When to skip it

Skip IMPORTHTML for login-protected pages, heavy JavaScript sites, or production pipelines that need guaranteed uptime. Use the Sheets API or a proper ETL tool instead.

How it works

  1. 1

    Find a stable public URL whose data lives in a real HTML table or list, not only in client-side JS.

  2. 2

    Use =IMPORTHTML(url, "table", 1) where the last number picks the first table on the page.

  3. 3

    Switch to "list" when the content is a ul or ol structure instead of a table.

  4. 4

    Increment the index if the wrong block imports, for example table 2 or list 3.

  5. 5

    Wrap results with QUERY or ARRAYFORMULA if you need to clean columns after import.

  6. 6

    Expect occasional #N/A or stale data when the site changes layout or blocks automated requests.

Examples in Google Sheets

Wikipedia table

=IMPORTHTML("https://en.wikipedia.org/wiki/...", "table", 2) grabs the second infobox table for a simple reference tab.

Published pricing grid

=IMPORTHTML(vendor_url, "table", 1) mirrors a public price list when the vendor still serves static HTML tables.

Rankings list

=IMPORTHTML(stats_page, "list", 1) pulls a numbered list into column A for weekly comparison charts.

Build this without starting from a blank cell

Use a Better Sheets tool for IMPORTHTML, then watch a walkthrough when you want the full pattern.

Better Sheets resources

Common mistakes

  • Targeting a page that renders data only with JavaScript, which leaves IMPORTHTML empty or wrong.
  • Hard-coding table index 1 when the site redesign adds a navigation table above your data.
  • Building critical billing logic on IMPORTHTML without a fallback when the site rate-limits Google.
  • Importing huge tables into the top-left of a busy tab with no room for spill growth.
  • Confusing IMPORTHTML with IMPORTXML; XPath is more flexible for nested markup.

Frequently asked questions

IMPORTHTML vs IMPORTXML?
IMPORTHTML is simpler for whole tables or lists. IMPORTXML uses XPath for precise nodes.
Why #N/A from IMPORTHTML?
The URL may be private, the index may be wrong, or the page structure changed.
Can IMPORTHTML import multiple tables?
Use separate formulas with different index numbers, one per table.
Does IMPORTHTML refresh automatically?
It recalculates on sheet refresh with Google limits. Do not expect real-time trading speeds.
Can I filter IMPORTHTML output?
Yes. Wrap with QUERY or FILTER on the spilled range.
IMPORTHTML and authentication?
It only works on publicly reachable URLs without login cookies.
How do I find the table index?
Start at 1 and increase until the imported columns match what you see in the browser view source.

Related Tutorials

Watch how IMPORTHTML works

Browse more tutorials
Create a Public Sheet and Private Sheet: Using ImportRange()

Create a Public Sheet and Private Sheet: Using ImportRange()

Stick around after the 1st portion of the video for bonus content.
Create Navigation Buttons in Sheets to Other Sheets

Create Navigation Buttons in Sheets to Other Sheets

Add a button to go to another sheet inside your sheet.
Convert Google Sheets into a REST API

Convert Google Sheets into a REST API

How to use Google Sheets as a database by turning it into a REST API wit...
Google Sheets Easter Eggs Beyond PRIDE

Google Sheets Easter Eggs Beyond PRIDE

Going beyond PRIDE, to show you some undocumented google sheets hacks th...
Embed a Headline in a Website from Google Sheets

Embed a Headline in a Website from Google Sheets

One of the most requested videos, Ever. How to put data, a number, some ...
Automatically Copy Spreadsheet Tab to New File with Values Only, No Formulas

Automatically Copy Spreadsheet Tab to New File with Values Only, No Formulas

Automatically copy a spreadsheet tab to a whole new spreadsheet file, ge...

Related blog posts

Guides that explain IMPORTHTML in more depth.

Browse the blog

Related glossary terms

Done reading about IMPORTHTML?

Membership unlocks 636+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.

Need this once

Jump to a free tool or a single tutorial for this topic.

Learning Sheets for real

Unlock the full library, generators, and templates with membership.