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
Find a stable public URL whose data lives in a real HTML table or list, not only in client-side JS.
-
2
Use =IMPORTHTML(url, "table", 1) where the last number picks the first table on the page.
-
3
Switch to "list" when the content is a ul or ol structure instead of a table.
-
4
Increment the index if the wrong block imports, for example table 2 or list 3.
-
5
Wrap results with QUERY or ARRAYFORMULA if you need to clean columns after import.
-
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.
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
Create a Public Sheet and Private Sheet: Using ImportRange()
Create Navigation Buttons in Sheets to Other Sheets
Convert Google Sheets into a REST API
Google Sheets Easter Eggs Beyond PRIDE
Embed a Headline in a Website from Google Sheets
Automatically Copy Spreadsheet Tab to New File with Values Only, No Formulas
Related blog posts
Guides that explain IMPORTHTML in more depth.
What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →Explore Coding in Google Sheets
Did you know you can actually code in Google Sheets?
Read post →Related terms
IMPORTXML
IMPORTXML fetches a URL and returns data matching an XPath query. You can scrape page titles, meta tags, table cells, or RSS-style XML fields. It is more precise than IMPORTHTML when you need one value or a repeating node set from structured markup.
Read guide →IMPORTRANGE
IMPORTRANGE loads values from a range in another Google spreadsheet into your current file. You pass the spreadsheet URL or key plus a range string with an optional sheet name. After you grant access once, the link stays live and updates when the source changes.
Read guide →IMPORTDATA
IMPORTDATA retrieves a text file from a web address and parses it into sheet cells. It works with comma- or tab-separated values published at a stable URL. Government open data, published exports, and simple report endpoints are common sources.
Read guide →IMPORTFEED
IMPORTFEED reads an RSS or Atom syndication URL and returns feed items in a table. You can request specific fields like titles, URLs, authors, or dates using query parameters. It is handy for lightweight media monitoring without a dedicated news tool.
Read guide →Done reading about IMPORTHTML?
Membership unlocks 600+ 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.