Render xlsx files in the browser without a server
You have an Excel file in a web app and want to show it to the user. The usual answers are to convert it to HTML on a server, to embed Office Online, or to parse it into a grid component and lose the formatting. There is a fourth option: open it in the browser with an engine that does what Excel does.
Why server-side conversion falls short
Converting xlsx to HTML or PDF on a server works until it doesn't. The file has to leave the browser, which is a problem for regulated customers and for anything under a data-processing agreement. The output is a static picture: formulas don't recalculate, filters and slicers don't work, and hidden sheets and comments are gone. And you now run and patch a conversion service, often LibreOffice in a container, whose rendering differs from Excel in ways your users notice.
Why grid components aren't enough
Grid libraries render cells well, and some bundle a formula engine. What they generally lack is the rest of the file: conditional formatting with icon sets and data bars, PivotTables, charts, table styles, sparklines, merged cells with rich text, theme colours, legacy drawings. Importing an xlsx into a grid usually means the parser extracts values and a subset of styles and discards the rest.
Rendering the file itself, client-side
Sheetwarden takes the file bytes in the browser, parses the package, calculates every formula with its own engine, and draws the sheets on a canvas. The result looks like the workbook because it is the workbook: the same styles, the same calculated values, the same pivots, rebuilt locally.
import {{ createExcelViewer }} from '@sheetwarden/viewer';
const viewer = createExcelViewer(document.getElementById('workbook'), {{ readOnly: true }});
await viewer.loadFile(file); // a File from an input, drag and drop, or a fetchParsing runs in a Web Worker so the page stays responsive, and the viewer renders only the visible cells, so a sheet with a million rows scrolls smoothly. There are no network requests; the library can run offline.
What you get for free
- Formulas calculated on open, including dynamic arrays, XLOOKUP, LET and LAMBDA, with the workbook's saved calculation mode respected.
- Conditional formatting, number formats, fonts, fills, borders, merged cells and rich text as saved.
- PivotTables rebuilt from their source data, with working slicers and timelines.
- Charts, pictures and shapes, including EMF and WMF drawings from older files.
- Find across sheets, sort and filter, a cell inspector, CSV export, and the original file for download.
- Password-protected files, opened locally with a prompt.
Beyond viewing
The same library edits workbooks and writes them back to xlsx with the untouched parts of the original preserved, and it runs VBA macros for xlsm files. If you only need display, the read-only option disables all of that and the Viewer licence tier covers it.
Format support
xlsx and xlsm (including encrypted), xlsb, legacy xls from Excel 97 onward, csv and tsv. The feature support matrix lists what is complete, partial and not available.
Related guides
- Excel viewer component for React, Vue and Angular
- Open xlsb and legacy xls files in JavaScript
- Alternatives to SheetJS Pro, SpreadJS and Handsontable
Try it now: open the live demo and drop in one of your own files. Nothing is uploaded. Then see the documentation or pricing.