To embed a Google Sheet in a webpage, open it in a browser and choose File > Share > Publish to web, select the sheet or content to publish, then choose Embed and copy the generated HTML into your site. The published iframe is a view-only display; it is different from sharing an editable spreadsheet link.
What a Google Sheets iframe embed does
An iframe is an HTML element that displays another webpage inside the current page. Google Sheets provides embed code for a published spreadsheet, so a site can show the sheet without recreating its rows and columns. Visitors can view the published content in the embedded frame, but the frame is not a way to grant them editing access to the original spreadsheet.
This is useful for material that changes occasionally and should be presented in a webpage, such as a public event schedule, a product list, a class timetable, or a set of public statistics. For example, a community group might publish a sheet containing event dates and embed it on its website. When the sheet is updated, the published view can reflect those changes, although the update may not appear instantly.
Embedding is not the same as granting access to the document through Google Drive. Publishing creates a version intended for public or organization-wide viewing, subject to the account’s available settings. A normal share link instead follows the spreadsheet’s sharing permissions and opens the document in Google Sheets.
How to publish and copy the embed code
Use Google Sheets in a web browser. The exact wording or layout of the dialog can vary slightly as Google updates its interface, but the usual workflow is:
- Open the spreadsheet and check that it contains only information you intend to publish.
- Choose File > Share > Publish to web.
- In the publishing dialog, choose whether to publish the entire spreadsheet or a specific sheet. If the dialog offers a content or format selector, choose the relevant content and the embed option.
- Choose Publish and confirm if prompted. If an Embed tab or option is shown, select it and copy the HTML code provided.
- Paste that code into an HTML or embed block on your website, then save or publish the webpage and check the result in a browser.
Publishing may be restricted by a Google Workspace administrator. If the publish option is unavailable, or publication is blocked by a policy message, ask the organization’s administrator whether publishing to the web is allowed. Do not try to work around an organizational restriction by copying the data to an unapproved account.
The generated snippet contains an <iframe> element and a source address for the published content. Use Google’s generated source rather than guessing or assembling the address yourself. If your website editor offers a dedicated embed block, use its instructions for inserting HTML; ordinary text blocks often display the code as text instead of rendering it.
Choose what visitors can see
Before publishing, decide whether visitors need the whole spreadsheet or just one tab. A multi-tab workbook can include working calculations, notes, or material that is not relevant to the webpage. Selecting a specific sheet, when the publishing dialog allows it, keeps the embedded view focused. Review the published result as a visitor would, rather than assuming that hidden tabs, protected ranges, or a tidy first sheet make the rest of a workbook private.
Publishing is a disclosure decision, not a security boundary. Treat anything included in the published output as information that may be seen by people beyond the intended audience. Remove personal details, confidential business information, private links, and internal notes before publishing. If a sheet contains data that must remain private, make a separate spreadsheet containing only the approved material and publish that copy instead.
Google may offer audience choices that depend on the type of account and administrator settings. Read the options in the dialog carefully. In particular, do not assume that publishing to the web is limited to people who already know your website address. A public page can be shared, indexed, or viewed outside the context you originally imagined, depending on the settings and how the page is distributed.
Publishing versus sharing a spreadsheet
These options solve different problems, and choosing the wrong one is a common source of confusion:
- Publish to web and embed: displays a published, view-only presentation inside a webpage. It is appropriate when a site’s visitors should see the information without editing the source.
- Share a link: opens the spreadsheet in Google Sheets. Access depends on the sharing setting, such as restricted access or access for people with the link. A link does not automatically create an iframe.
- Invite specific people: grants named Google accounts viewer, commenter, or editor access, according to the permissions selected. This is usually a better fit for collaboration or nonpublic work.
An iframe does not turn a published sheet into a collaborative spreadsheet. If visitors need to enter data, comment, or edit cells, use an appropriate Google sharing workflow or a purpose-built form rather than expecting the embedded display to accept changes. Also, changing a spreadsheet’s sharing setting and changing its publish setting are separate actions; review both if the document has been shared or published in the past.
Adjusting the display and fitting it to a page
The embed code Google supplies includes dimensions for the frame. You can usually change the width and height values in the HTML to better fit your site, provided your site editor allows editing the code. A fixed width may suit a page with a known layout, while a narrower frame can create horizontal scrolling for a wide spreadsheet. A height that is too small forces visitors to scroll inside a short window; one that is too large can dominate the page.
For a responsive layout, place the iframe in a container that follows the site’s content width, or use the responsive embed tools provided by your website platform. Some content-management systems accept only approved iframe sources or provide their own width and height controls. In that case, follow the platform’s supported method rather than pasting arbitrary markup. Test on both a desktop-sized browser and a phone: spreadsheet columns may be difficult to read on a narrow screen even when the frame itself resizes correctly.
Keep a clear heading or short explanation near the embed so visitors know what the data represents and how current it is. If the spreadsheet is wide, consider whether the webpage needs the whole table. A small, carefully chosen published sheet is often easier to use than a large workbook squeezed into a narrow frame.
Updates, stopping publication, and ownership
Publishing is not necessarily a one-time snapshot. Depending on the publishing settings, changes to the source spreadsheet can be reflected in the published view, sometimes after a delay. Check the publishing dialog for an option related to automatically republishing changes, and confirm the setting that applies to the spreadsheet. If a change does not appear right away, wait briefly and reload the webpage before assuming the embed code is broken.
If the published content should no longer be available, return to File > Share > Publish to web and use the option to stop publishing, if it is available in the dialog. Also remove the iframe from your website. Removing the iframe alone only removes it from that page; it does not necessarily stop publication or prevent someone from using the published address. If the source file has also been shared with people, review its Google Drive sharing settings separately.
Consider who owns the spreadsheet and the website. If an employee or volunteer leaves, a site may continue displaying content tied to a spreadsheet managed by that person’s account. Assign an appropriate owner or transfer ownership according to the organization’s Google account rules, and keep a note of where the embed is used. That makes it easier to update, audit, or turn off the display later.
Common iframe problems and fixes
- The code appears on the page instead of the sheet. The editor may be treating the snippet as plain text. Use an HTML, custom-code, or iframe embed block supported by the site platform.
- The frame is blank or shows an access message. Confirm that the sheet was published, that the chosen audience can view it, and that the embed uses the complete generated code. A Google Workspace policy or a site security rule may also block the frame.
- The embed does not update. Check that the source sheet was edited, verify the republishing setting, and allow time for the published view to refresh. Reload the webpage after checking.
- The sheet is cut off. Increase the iframe dimensions or use a responsive container. The sheet itself may also be wider than the available page area.
- The website removes the iframe. Some platforms restrict iframe HTML for security. Use the platform’s supported Google Sheets embed feature or ask the site administrator to allow the approved embed method.
When diagnosing a problem, distinguish between the sheet’s publication and the website’s ability to display an iframe. If the published address works on its own but the page does not show it, the problem is more likely to involve the site editor, its security rules, or the iframe’s layout. If the published address itself is unavailable, check the spreadsheet’s publishing status and organizational restrictions first.
Alternatives to an iframe
An iframe is convenient when visitors should see a live, scrollable spreadsheet, but it is not always the best presentation. A normal view-only link is simpler if it is acceptable for visitors to leave the website and open Google Sheets. A static table built into the webpage may be better for a small amount of information that rarely changes, while a chart or dashboard can communicate trends more clearly than a full grid. A Google Form is a better option when the goal is to collect responses rather than display cells.
Choose based on the visitor’s task. A schedule benefits from a familiar table that can be updated centrally; a short list may be faster to read directly on the page; sensitive working data should not be published at all. If the source is a changing public dataset, check how often it needs to update and whether the embedded sheet remains usable on mobile before committing to this approach.
Frequently Asked Questions
Can I embed a Google Sheet without publishing it?
Google’s standard iframe workflow uses the Publish to web feature. A regular sharing link is not the same as an embed code. If the content must remain restricted, do not publish it publicly; use a permission-controlled link or another approved method instead.
Can people edit a Google Sheet inside an iframe?
The published iframe is intended to display the published content, not to provide editing access to the source spreadsheet. Give collaborators the appropriate Google Sheets permissions and link them to the document if they need to edit.
Will an embedded Google Sheet update when I change the original?
It can reflect source changes according to the publishing settings, but updates may not be immediate. Check whether automatic republishing is enabled in the publishing dialog and allow time for the published view to refresh.
Can I embed only one tab?
When publishing, the dialog can offer a choice between the whole spreadsheet and an individual sheet. Select the intended tab before copying the embed code, then review the published result to ensure it shows the content you meant to share.
Why does my website block the Google Sheets iframe?
A site builder may disable custom HTML or permit only approved iframe sources. Use its dedicated embed block if available, and check the site’s security or administrator settings. Changing the spreadsheet’s publication settings will not override restrictions imposed by the website.
Related
- How to Freeze the First Two Rows in Excel While Scrolling
- Keep Color Formatting in Excel While Editing Data
- How to Keep Date Format in Excel
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Import Data from Multiple CSV FilesTo import data from multiple CSV files into Excel for Microsoft 365 on Windows, put the files in…
- Timestamp to Date in Google Sheets: Convert Unix TimeTo convert a Unix timestamp in seconds to a date and time in Google Sheets, put the timestamp…
- How to Delete a Blank First Page in Microsoft WordTo delete a blank first page in Microsoft Word, show formatting marks, remove any empty paragraphs or page…
- Excel Copy and Paste Slow? Practical Causes and FixesWhen Excel is very slow copying and pasting, the usual causes are a large or complex selection, heavy…
- Remove Endnote Formatting in Word Without Losing NotesTo remove formatting from endnotes in Microsoft Word for Microsoft 365 on Windows, select the endnote text, press…
- Conditional Formatting in Excel: Color Coding GuideYes—conditional formatting in Excel automatically color-codes cells when their values meet rules you set. Select the cells, then…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.