Docs & officedocs.google.com/spreadsheets

Can you embed Google Sheets in an iframe?

Yes. Use File, Share, Publish to web to embed the whole spreadsheet or one sheet. Google documents only the published copy for embeds.

Checked Test again

Live check

What the main page sends

Result of
Edit linkEmbeddable
docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit
X-Frame-Options
Not sent
CSP frame-ancestors
Not sent
Response
200 OK · 389 ms · HTTPS
Published linkNot checked
docs.google.com/spreadsheets/d/e/{published-id}/pubhtml?widget=true&headers=false

Not checked: needs your own link. Google Sheets has no public sample we can load.

Test your link

Steps

How to embed Google Sheets

  1. Open the spreadsheet in Google Sheets.
  2. At the top, clickFilethenSharethenPublish to web
  3. In the window, click Embed.
  4. Select the entire spreadsheet or one sheet.
  5. Click Publish.
  6. Copy the HTML in the text box. Paste it into your page.

Publishing makes the data visible to the audience you choose.

Published charts also show the data behind them. Check for private data before you publish.

Embed code

Paste this into your page

HTML
<iframe
  src="https://docs.google.com/spreadsheets/d/e/{published-id}/pubhtml?widget=true&amp;headers=false"
  width="100%"
  height="600"
  style="border: 0"
  title="{spreadsheet title}">
</iframe>

Use the src from the embed code that Google gives you. Then add or change the parameters below.

URL patterns

Swap the link you have for the embed URL

  • You have…/spreadsheets/d/{sheet-id}/editUse in the iframe…/spreadsheets/d/e/{published-id}/pubhtml
  • You haveShow one sheetUse in the iframe&gid={sheet-gid}
  • You haveShow some cellsUse in the iframe&range=A1:B14
  • You haveShow or hide the sheet tabsUse in the iframe&widget=true or false
  • You haveShow or hide row numbers and column lettersUse in the iframe&headers=true or false
  • You haveShow or hide the title and footerUse in the iframe&chrome=true or false

Google documents these parameters for the embed HTML. Get the published ID from Publish to web.

Good to know

  • Visitors see a version with no toolbar. They see values, charts and formatting, but not formulas.
  • Visitors cannot edit the embedded sheet.
  • Changes show automatically while "Automatically republish when changes are made" is checked under Published content & settings.
  • In work or school accounts, the administrator can turn off publishing.
  • To stop, open File, Share, Publish to web, then Published content & settings, then Stop publishing.

Sources

Profile updated

Know before you embed.

Free, no sign-up, nothing stored. Paste a URL and get a verdict, a live preview, and the fix.