How to create an Excel File with javascript?

I would like to know if it is possible to create an Excel File and make it downloaded from a web page with javascript ?

Currentlly, I succes to create a .csv and make it downloaded with the following code :

var blob = new Blob([csvText], { type: 'text/csv;charset=UFT-8;' });
var link = document.createElement("a");
if ( !== undefined) { // feature detection
    // Browsers that support HTML5 download attribute
    var url = URL.createObjectURL(blob);
    link.setAttribute("href", url);
    link.setAttribute("download", "file.csv"); = 'hidden';

I am wondering if there is any librairies in javascript with permit to convert the file from csv format to xlsx format and make it downloaded the same way than the csv ?

The final aim is to set a template in the downlaoded xlsx.


  • There is couple of options

    Another github project with less Excel options but less worries about Excel compatibility issues can be found here: ExcellentExport.js