SimpleExcel.js - WIP client-side script to parse / convert / write XML / CSV / TSV / HTML / JSON / etc formats.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 4e7788a Nov 25, 2016


Client-side script to easily parse / convert / write any Microsoft Excel XLSX / XML / CSV / TSV / HTML / JSON / etc formats. As for server-side solution you might want to check SimpleExcelPHP


<!doctype html>
        <script type="text/javascript" src="simple-excel.js"></script>
        <input type="file" id="fileInput" /><br/>
        <input type="button" id="fileExport" />
        <script type="text/javascript">

            // read a CSV file
            var csvParser = new SimpleExcel.Parser.CSV();
            var fileInput = document.getElementById('fileInput');
            // parse when file loaded, then print the result to console
            fileInput.addEventListener('change', function (e) {            
                var file =[0];
                csvParser.loadFile(file, function () {
                    console.log(csvParser.getSheet()); // print!

            // write an XLSX file            
            var xlsxWriter = new SimpleExcel.Writer.XLSX();
            var xlsxSheet = new SimpleExcel.Sheet();
            var Cell = SimpleExcel.Cell;
                [new Cell('ID', 'TEXT'), new Cell('Nama', 'TEXT'), new Cell('Kode Wilayah', 'TEXT')],
                [new Cell(1, 'NUMBER'), new Cell('Kab. Bogor', 'TEXT'), new Cell(1, 'NUMBER')],
                [new Cell(2, 'NUMBER'), new Cell('Kab. Cianjur', 'TEXT'), new Cell(1, 'NUMBER')],
                [new Cell(3, 'NUMBER'), new Cell('Kab. Sukabumi', 'TEXT'), new Cell(1, 'NUMBER')],
                [new Cell(4, 'NUMBER'), new Cell('Kab. Tasikmalaya', 'TEXT'), new Cell(2, 'NUMBER')]
            // export when button clicked
            document.getElementById('fileExport').addEventListener('click', function () {            
                xlsxWriter.saveFile(); // pop! ("Save As" dialog appears)



GPLv2 & MIT License

Copyright © 2013 Faisalman <>