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
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=falseNot checked: needs your own link. Google Sheets has no public sample we can load.
Test your linkSteps
How to embed Google Sheets
- Open the spreadsheet in Google Sheets.
- At the top, clickFilethenSharethenPublish to web
- In the window, click Embed.
- Select the entire spreadsheet or one sheet.
- Click Publish.
- 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&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
- Google Docs Editors Help · Make Google Docs, Sheets, Slides & Forms publicsupport.google.com/docs/answer/183965
- Google Sheets API · JavaScript quickstart (sample spreadsheet)developers.google.com/workspace/sheets/api/quickstart/js
- iframecheck live check · main page
Profile updated