Overview | SheetJS Community Edition

SheetJS Community Edition offers battle-tested open-source solutions for extracting useful data from almost any complex spreadsheet and generating new spreadsheets that will work with legacy and modern software alike.

SheetJS Pro offers solutions beyond data processing: Edit complex templates with ease; let out your inner Picasso with styling; make custom sheets with images/graphs/PivotTables; evaluate formula expressions and port calculations to web apps; automate common spreadsheet tasks, and much more!

Simple Examples

The code editors are live -- feel free to edit! They use ReactJS components and run entirely in the web browser.

Export an HTML Table to Excel XLSX

How to add to your site (click to show)
  • HTML
  • React
  1. Make sure your table has an ID:
<table id="TableToExport">
  1. Include a reference to the SheetJS library in your page:
<script src="https://cdn.sheetjs.com/xlsx-0.20.3/package/dist/xlsx.full.min.js"></script>
  1. Add a button that users will click to generate an export
<button id="sheetjsexport"><b>Export as XLSX</b></button>
  1. Add an event handler for the click event to export table data to XLSX:
<script>
document.getElementById("sheetjsexport").addEventListener('click', function() {
/* Create worksheet from HTML DOM TABLE */
var wb = XLSX.utils.table_to_book(document.getElementById("TableToExport"));
/* Export to file (start a download) */
XLSX.writeFile(wb, "SheetJSTable.xlsx");
});
</script>
How to automate with NodeJS (click to show)
Live Example (click to hide)

This example uses a ReactJS ref to reference the HTML TABLE element. ReactJS details are covered in the ReactJS demo


function Table2XLSX(props) {
  
  const tbl = React.useRef();

  
  const xport = React.useCallback(() => {
    
    const wb = XLSX.utils.table_to_book(tbl.current);

    
    XLSX.writeFile(wb, "SheetJSTable.xlsx");
  });

  return ( <>
    <table ref={tbl}><tbody>
      <tr><td colSpan="3">SheetJS Table Export</td></tr>
      <tr><td>Author</td><td>ID</td><td>你好!</td></tr>
      <tr><td>SheetJS</td><td>7262</td><td>வணக்கம்!</td></tr>
      <tr><td colSpan="3">
        <a href="//sheetjs.com">Powered by SheetJS</a>
      </td></tr>
    </tbody></table>
    <button onClick={xport}><b>Export XLSX!</b></button>
  </> );
}

SheetJS Pro Basic extends this export with support for CSS styling and rich text.

Download and Preview Apple Numbers Workbooks

How to add to your site (click to show)
  1. Create a container DIV for the table:
<div id="TableContainer"></div>
  1. Include a reference to the SheetJS library in your page:
<script src="https://cdn.sheetjs.com/xlsx-0.20.3/package/dist/xlsx.full.min.js"></script>
  1. Add a script block to download and update the page:
<script>
(async() => {
/* replace with the URL of the file */
const URL_TO_DOWNLOAD = "https://docs.sheetjs.com/pres.numbers";
const ab = await (await fetch(URL_TO_DOWNLOAD)).arrayBuffer();

/* Parse file and get first worksheet */
const wb = XLSX.read(ab);
const wsname = wb.SheetNames[0];
const ws = wb.Sheets[wsname];

/* Generate HTML */
var output = document.getElementById("TableContainer");
output.innerHTML = XLSX.utils.sheet_to_html(ws);
})();
</script>
Live Example (click to hide)

This demo processes https://docs.sheetjs.com/pres.numbers


function NUMBERS2HTML(props) {
  const [__html, setHTML] = React.useState("");

  
  React.useEffect(() => { (async() => {
    
    const f = await fetch("https://docs.sheetjs.com/pres.numbers");
    const ab = await f.arrayBuffer();

    
    const wb = XLSX.read(ab);
    const ws = wb.Sheets[wb.SheetNames[0]];

    
    setHTML(XLSX.utils.sheet_to_html(ws));
  })(); }, []);

  return ( <div dangerouslySetInnerHTML={{ __html }}/> );
}

SheetJS Pro Basic extends this import with support for CSS styling and rich text.

Preview a workbook on your device

Live Example (click to hide)

This example starts from a CSV string. Use the File Input element to select a workbook to load. Use the "Export XLSX" button to write the table to XLSX.


function Tabeller(props) {
  const [__html, setHTML] = React.useState("");

  
  React.useEffect(() => {
    
    const csv = `\
This,is,a,Test
வணக்கம்,สวัสดี,你好,가지마
1,2,3,4`;

    
    const wb = XLSX.read(csv, {type: "string"});

    
    const ws = wb.Sheets.Sheet1;

    
    setHTML(XLSX.utils.sheet_to_html(ws, { id: "tabeller" }));
  }, []);

  return ( <>
    {}
    <input type="file" onChange={async(e) => {
      
      const file = e.target.files[0];
      const data = await file.arrayBuffer();

      
      const wb = XLSX.read(data);
      const ws = wb.Sheets[wb.SheetNames[0]];
      setHTML(XLSX.utils.sheet_to_html(ws, { id: "tabeller" }));
    }}/>

    {}
    <button onClick={() => {

      
      const table = document.getElementById("tabeller");
      const wb = XLSX.utils.table_to_book(table);

      
      XLSX.writeFile(wb, "SheetJSIntro.xlsx");
    }}><b>Export XLSX!</b></button>

    {}
    <div dangerouslySetInnerHTML={{ __html }}/>
  </> );
}

Browser Testing

The test suite is regularly run against a number of modern and legacy browsers using Sauce Labs.

Browser tests for SheetJS version 0.20.3 were run on 2026-01-12:

Build Status

In previous runs, tests passed in:

  • Internet Explorer 6 - 11
  • Chrome versions starting from 26
  • Safari iOS versions starting from 8
  • Android Browser versions starting from 5.1
  • Safari macOS versions starting from 6
  • Edge 13 - 18 and versions starting from 79
  • Konqueror 22

Sauce Labs has removed many legacy browser versions over the years. SheetJS LLC still maintains testing infrastructure for legacy deployments. Questions about legacy browsers should be asked in the SheetJS chat.

For continued support with relevant runtimes including Salesforce LWC, NetSuite SuiteScripts, and Adobe ExtendScript, SheetJS libraries include fallbacks and shims that help preserve support in legacy browser environments.

Supported File Formats

"File Formats" lists the supported file formats.

graph of format support

graph legend