ScreenshotNeo

BlogHow-to

How to Turn a Google Sheet Into a Website

Publish a Google Sheet as a web page, embed it on your site, or build a custom directory with practical steps, code, access checks, and troubleshooting.

By the ScreenshotNeo team1 October 20269 min read

To turn a Google Sheet into a website, use Google Sheets’ built-in Publish to web feature. It creates a view-only public URL or embed code for the whole spreadsheet or a selected tab. If you need a branded directory, portal, mobile app, or user-specific experience, connect the sheet to a site builder or use the Google Sheets API for a custom application.

This guide covers the native method first, then Google Sites, no-code builders, and a coded approach. It also explains publication permissions, update delays, embed options, common failures, and how to capture the finished page.

1. Publish a Google Sheet as a web page

  1. Open the spreadsheet on a computer.
  2. Choose File > Share > Publish to web.
  3. Choose Entire document or a specific sheet tab.
  4. Select the available publishing format.
  5. Click Publish and confirm.
  6. Copy the public link, or open the Embed tab and copy the generated HTML.

The published result is a view-only presentation. Visitors can see values, formatting, and charts, but they do not receive the editing interface or your formulas as an editable workbook. Google documents this workflow in Make Google Docs, Sheets, Slides & Forms public.

Choose the whole spreadsheet or one tab

Publishing the entire document exposes every selected tab in the public view. Publishing one sheet limits the output to that tab. Review hidden, archived, and helper tabs before choosing the scope; a tab that is not part of your intended website may still contain sensitive data.

Use the generated embed code

Paste Google’s generated snippet into an HTML block, CMS custom-code field, or page template that permits iframes. A typical embed looks like this:

<iframe
  src="https://docs.google.com/spreadsheets/d/e/YOUR_PUBLISHED_ID/pubhtml?gid=0&single=true"
  width="100%"
  height="600"
  frameborder="0"
  scrolling="no"
  title="Public spreadsheet"
></iframe>

Start with the code Google generates for your file. Depending on the target site, you may be able to adjust documented parameters such as:

Parameter Purpose
gid Identifies the sheet tab.
range Limits the published cells to a range.
widget Controls spreadsheet widget behavior.
headers Controls whether row and column headers appear.
chrome Controls parts of the surrounding spreadsheet chrome.

Use URL encoding when adding parameters yourself. If your CMS strips iframe attributes, use its official embed block or keep the generated URL as a normal link.

2. Make the embedded sheet fit your site

Responsive iframe wrapper

<div class="sheet-frame">
  <iframe
    src="https://docs.google.com/spreadsheets/d/e/YOUR_PUBLISHED_ID/pubhtml?gid=0&single=true"
    title="Product directory"
    loading="lazy"
  ></iframe>
</div>

<style>
.sheet-frame {
  width: 100%;
  overflow: auto;
  border: 1px solid #d9dee7;
  border-radius: 8px;
}
.sheet-frame iframe {
  display: block;
  width: 100%;
  min-width: 720px;
  height: 70vh;
  min-height: 480px;
  border: 0;
}
</style>

A sheet with many columns may need horizontal scrolling on phones. If mobile readers need cards, filters, or navigation rather than a grid, an app or custom front end is usually a better fit than an iframe.

A normal link avoids iframe restrictions and is easier to share:

<a href="https://docs.google.com/spreadsheets/d/e/YOUR_PUBLISHED_ID/pubhtml"
   rel="noopener"
   target="_blank">
  Open the public directory
</a>

3. Embed a Sheet in Google Sites

  1. Publish the spreadsheet first.
  2. Open the Google Site in edit mode.
  3. Open Insert and choose the Sheets file or embed option.
  4. Place and resize the content.
  5. Publish the site changes.

Google Sites can host the embedded sheet, but the spreadsheet still has its own access rules. Publishing the site does not automatically make a restricted source available to every visitor. See Google Sites: Add Google files, videos, website content and more.

4. Decide whether native publishing is enough

Approach Use it when Trade-offs
Sheets Publish to web You need a quick, read-only table, chart, or simple embed. It keeps the spreadsheet presentation and is not a user-specific portal.
Google Sites You want a simple site containing a sheet and other Google files. The embedded sheet retains separate permissions and spreadsheet behavior.
Softr You need a branded portal, directory, dashboard, or permissioned interface. Softr describes app blocks, permissions, and sync; verify current limits and pricing before choosing it.
Glide You want a customizable, mobile-friendly app backed by a Google Sheet. Confirm current data-source and plan requirements with Glide.
Sheets to Site Marketplace add-on You want spreadsheet-driven listings or generated pages. Check the current Marketplace listing, permissions, pricing, and availability.
Google Sheets API You need complete control over design, filtering, authentication, and business logic. You must build and operate the application and handle API permissions correctly.

These vendor pages describe claimed capabilities rather than independent performance tests: Softr with Google Sheets, Glide with Google Sheets, and the Sheets to Site Marketplace listing.

5. Build a custom website with the Google Sheets API

The API route lets your server read or write spreadsheet values and render them in your own HTML. Access is determined by the permissions of the requesting application. Keep credentials on the server and never expose a service-account key or OAuth client secret in browser JavaScript. Start with Google’s Sheets API documentation.

Example: read a range with Python

from google.oauth2.service_account import Credentials
from googleapiclient.discovery import build

SCOPES = ["https://www.googleapis.com/auth/spreadsheets.readonly"]
creds = Credentials.from_service_account_file(
    "service-account.json", scopes=SCOPES
)
service = build("sheets", "v4", credentials=creds)

spreadsheet_id = "YOUR_SPREADSHEET_ID"
result = service.spreadsheets().values().get(
    spreadsheetId=spreadsheet_id,
    range="Public!A1:F100"
).execute()

rows = result.get("values", [])
for row in rows:
    print(row)

Render safely in a server-side template

Escape cell values before inserting them into HTML. Treat spreadsheet content as untrusted input: a cell can contain markup, a URL, or text that resembles a script. Add pagination or a bounded range instead of loading thousands of rows into every request.

6. Check privacy and publication permissions

Publishing is a data-release decision. Google says publication visibility can be web-wide, limited to an organization, or limited to a group, depending on account and Workspace settings. Before clicking Publish:

  • Inspect every tab, including hidden and helper tabs.
  • Review charts because a published chart can reveal the data behind it.
  • Remove emails, internal notes, private URLs, credentials, and personal data.
  • Confirm whether your organization or shared-drive administrator restricts public publishing.
  • Open the published URL in an incognito window and test it as an unauthenticated visitor.

Stop publishing

Open File > Share > Publish to web > Published content & settings, select the published item, and choose Stop publishing. Changing collaborator sharing is a separate action and does not necessarily remove an already published copy.

7. Understand updates and caching

Google states that edits to the original update the published version, but automatic propagation can take a few minutes. The Published content & settings panel lets you adjust automatic republishing. Do not promise visitors that a just-saved cell will appear immediately.

If your site or CDN caches the iframe or link, use a suitable cache policy for the surrounding page. For a custom API application, cache stable rows and invalidate them when your update workflow completes. Avoid aggressive caching for data that changes frequently or has access-sensitive content.

8. Troubleshooting

Symptom Likely cause Fix
Visitors see an access request The source or published view is restricted. Check Publish to web visibility, Workspace policy, and the source file’s permissions. Test in a private window.
The wrong tab appears The URL has the wrong gid, or the whole document was published. Republish the intended tab and use Google’s generated embed URL.
Recent edits are missing Google’s publication update is still propagating, or automatic republishing is disabled. Wait a few minutes, inspect Published content & settings, and republish if required.
Some columns are cut off The iframe is narrower than the sheet’s minimum content width. Use a responsive wrapper with horizontal scrolling, reduce columns, or build a mobile card view.
The iframe is blank in a CMS The editor stripped iframe HTML or the URL is not the published URL. Use the CMS’s official embed block and paste the pubhtml URL.
A chart exposes unexpected data Published charts can expose their underlying data. Remove private source ranges or publish a sanitized spreadsheet.
API requests return 401 or 403 Credentials, scopes, or spreadsheet sharing are incorrect. Check the OAuth scope, share the file with the requesting identity when appropriate, and keep secrets server-side.
API requests are slow or quota-limited Large ranges and one request per cell create unnecessary calls. Batch ranges, request only needed columns, paginate, and cache results.

9. Performance, reliability, and cost considerations

  • Native embed: simplest maintenance path, but the spreadsheet UI and iframe dimensions determine the reader experience.
  • Custom front end: gives better filtering and responsive design, but adds hosting, authentication, error handling, and API quota work.
  • Data size: keep public sheets narrow and bounded. Split large datasets or precompute a public tab.
  • Reliability: provide a direct published-sheet link as a fallback if an iframe is blocked, and handle API timeouts with retries and backoff.
  • Cost: the native publish flow does not require a separate website builder, while third-party plans, hosting, and API usage may have current limits or charges. Verify those terms with the provider.

10. Capture the finished page as an image or PDF

After publishing the page, you may need a screenshot for documentation, a social card, a regression check, or a PDF archive.

Or skip the browser setup

ScreenshotNeo captures a published URL with one request. It accepts cookie and consent banners like a visitor, removes more than 60 known consent platforms plus newsletter popups and chat widgets before capture, and lets you turn each cleanup step off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed; the response identifies the result with X-Page-Verdict and X-Billed headers.

See the ScreenshotNeo API documentation for all options, including full-page capture, element selectors, device presets, retina scale, custom CSS and JavaScript, waits, blocking rules, headers, cookies, timezone, geolocation, transparent backgrounds, resizing, caching, signed links, asynchronous jobs, bulk capture, usage, and PDF output.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://docs.google.com/spreadsheets/d/e/YOUR_PUBLISHED_ID/pubhtml \
  -o sheet.webp

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={
        "access_key": "YOUR_API_KEY",
        "url": "https://docs.google.com/spreadsheets/d/e/YOUR_PUBLISHED_ID/pubhtml",
    },
    timeout=90,
)
r.raise_for_status()
open("sheet.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://docs.google.com/spreadsheets/d/e/YOUR_PUBLISHED_ID/pubhtml'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const image = Buffer.from(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('sheet.webp', image));

ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

FAQ

Can I make a Google Sheet fully editable on my website?

Publish to web creates a view-only presentation. Use the original Sheets interface with appropriate sharing, or build an authenticated application with the Sheets API for controlled editing.

Does publishing expose formulas?

Visitors receive the published presentation of values, formatting, and charts rather than the normal editing workbook. Still inspect the source and chart data before publishing.

Can I publish only part of a sheet?

Choose a specific tab during publication, and use the documented range parameter when the generated embed supports it.

How do I turn a sheet into a searchable directory?

For a quick table, publish and embed it. For filters, branded pages, permissions, or mobile cards, use a builder such as Softr or Glide, or create a custom front end with the Sheets API.

What happens when the source sheet changes?

Google says changes flow to the published version automatically, but updates may take a few minutes. Check the republish setting if changes do not appear.