xls

utility

xls is a JavaScript library for parsing Excel 5.0/95 and 97-2004 spreadsheet files (BIFF5 XLS / BIFF8 XLS / XML 2003). It allows web applications to read Excel files and extract data from them.

Latest Ver
Homepage
Github
0
35,601
📢 xls is a JavaScript parser that allows reading and processing Excel files on the web.
License: Apache License, Version 2.0

Sample Code

⚠️ Some code, including import statements, may not run properly on jsFiddle. If it fails to execute, please copy the code and try it in your own environment.
📄 HTML
<div id='example'>
  <input type='file' id='fileInput'>
  <div id='output'>
    <h3>Excel Data:</h3>
    <pre id='data'></pre>
  </div>
</div>

🧩 External JS
<script src="https://cdnjs.cloudflare.com/ajax/libs/xls/0.7.4/xls.js"></script>

⚙️ JavaScript
document.getElementById('fileInput').addEventListener('change', function(e) {
  var file = e.target.files[0];
  if (!file) return;
  var reader = new FileReader();
  reader.onload = function(e) {
    var data = e.target.result;
    var workbook = XLS.read(data, {type: 'binary'});
    var first_sheet_name = workbook.SheetNames[0];
    var worksheet = workbook.Sheets[first_sheet_name];
    var output = XLS.utils.sheet_to_json(worksheet, {header:1});
    document.getElementById('data').innerText = JSON.stringify(output, null, 2);
  };
  reader.readAsBinaryString(file);
});
⚡ Top Tools for Developers
Text Compare

Text Comparison

Easily spot the differences between two texts.

Favicon Generator

Favicon Generator

Quickly and easily generate favicons.

Lorem Ipsum Generator

Lorem Ipsum Generator

Generate placeholder text for your designs.

Character Counter

Character Counter

Check character and word count in real time.

SRT ↔ SMI

SRT ↔ SMI Converter

Easily convert between subtitle formats.

Text Extract(OCR)

Image Text Extractor

Automatically extract text from images.