How to Embed an Excel Viewer in a Website — 3 Free Methods
Table of Contents
If you want to display a spreadsheet on a webpage so visitors can view the data without downloading a file, you have three main free options: Google Sheets embed, OneDrive embed, and the SheetJS JavaScript library. Each has different trade-offs around privacy, control, and setup complexity.
Method 1: Google Sheets Embed — Easiest Option
If your data can live in a Google Sheet, this is the simplest way to embed a spreadsheet viewer on any webpage:
Steps:
- Upload your Excel file to Google Drive and open it in Google Sheets
- Click File > Share > Publish to web
- Select "Embed," choose the sheet and range, and click "Publish"
- Copy the generated
<iframe>code and paste it into your webpage HTML
Sample embed code:
<iframe src="https://docs.google.com/spreadsheets/d/SHEET_ID/pubhtml" width="100%" height="400" frameborder="0"> </iframe>
Pros: Zero hosting cost, no code required, updates automatically when you edit the Sheet.
Cons: Requires a Google account. Data is publicly accessible (anyone with the link can view it). Google branding appears in the embedded view.
Method 2: OneDrive Excel Embed (Microsoft)
Microsoft OneDrive and SharePoint Online support embedding Excel files in webpages via an iframe. This keeps your data in the Microsoft ecosystem.
Steps:
- Upload your Excel file to OneDrive
- Open the file in Excel Online (browser version)
- Click File > Share > Embed
- Configure the embed options (which cells to show, interaction level) and copy the iframe code
Pros: Excel-accurate rendering, supports charts and pivot tables in the embed view, integrates with Microsoft 365.
Cons: Requires a Microsoft account (personal or business). The embedded file must be publicly shared or the viewer must be signed in. OneDrive personal storage limits apply.
Sell Custom Apparel — We Handle Printing & Free ShippingMethod 3: SheetJS — Full Control, No External Dependency
SheetJS is an open-source JavaScript library that reads .xlsx, .xls, .csv, and other formats directly in the browser. If you want to host your own spreadsheet viewer with no reliance on Google or Microsoft, SheetJS is the path.
Basic embed example:
<script src="https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js"></script>
<div id="grid"></div>
<script>
fetch("data.xlsx")
.then(r => r.arrayBuffer())
.then(buf => {
const wb = XLSX.read(buf);
const html = XLSX.utils.sheet_to_html(wb.Sheets[wb.SheetNames[0]]);
document.getElementById("grid").innerHTML = html;
});
</script>
Pros: No external service dependency, full control over styling, data can stay on your own server, no Google or Microsoft account required.
Cons: Requires developer skills. You handle styling, accessibility, and updates yourself. CDN version ties you to SheetJS versioning.
Choosing the Right Excel Embed Method
| Method | Setup Difficulty | External Account | Hosting Cost | Styling Control |
|---|---|---|---|---|
| Google Sheets embed | Easy (5 min) | Free | Minimal | |
| OneDrive embed | Easy (5 min) | Microsoft | Free | Minimal |
| SheetJS | Developer (1-2 hrs) | None | Your server | Full |
For most use cases, Google Sheets embed takes 5 minutes and works well. If you need Microsoft-accurate rendering, use OneDrive. For full control with no external dependency, SheetJS is the right choice but requires development time.
When to Link to a Viewer Instead of Embedding
Embedding a spreadsheet makes sense when your data is a core part of the page — reference tables, price lists, datasets users need to browse.
For cases where viewers just need to open a file you have provided for download, consider linking to a browser-based viewer instead:
- Host your Excel file as a download link on your page
- Provide a "View online" link pointing to a browser-based viewer
- Users click the link, open the viewer, and load the file themselves
This approach requires no embed setup and the viewer handles all the rendering complexity.
Try It Free — No Signup Required
Runs 100% in your browser. No data is collected, stored, or sent anywhere.
Open Free Excel ViewerFrequently Asked Questions
How do I embed an Excel file viewer in a website for free?
Three free methods: Google Sheets embed (upload to Sheets, use File > Share > Embed), OneDrive embed (upload to OneDrive, use Excel Online share > Embed), or SheetJS (open-source JavaScript library for custom builds). Google Sheets is the easiest for non-developers.
Can I embed an Excel viewer without Google or Microsoft accounts?
Yes, using SheetJS — an open-source JavaScript library that renders spreadsheets in the browser without any external service. It requires developer skills to implement but has no account dependency.
Does embedding a Google Sheets spreadsheet make the data public?
When you publish a Google Sheet to the web for embedding, the data becomes publicly viewable by anyone with the embed URL. Only share data publicly that is appropriate for public access.
Is there a simpler alternative to embedding for sharing Excel files?
Yes. Host the Excel file as a download and link to a browser-based viewer tool. Users open the viewer in their browser and load the file themselves — no embed setup required on your end.

