PHPackages                             damienlagae/xlsxwriter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. damienlagae/xlsxwriter

AbandonedArchivedProject[PDF &amp; Document Generation](/categories/documents)

damienlagae/xlsxwriter
======================

PHP Library to write XLSX files

1.0(9y ago)121.2k2[2 issues](https://github.com/damienlagae/PHP_XLSXWriter/issues)MITPHPPHP &gt;=5.2.1

Since Oct 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/damienlagae/PHP_XLSXWriter)[ Packagist](https://packagist.org/packages/damienlagae/xlsxwriter)[ Docs](https://github.com/damienlagae/PHP_XLSXWriter)[ RSS](/packages/damienlagae-xlsxwriter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

PHP\_XLSXWriter
===============

[](#php_xlsxwriter)

This library is designed to be lightweight, and have relatively low memory usage.

It is designed to output an Excel spreadsheet in with (Office 2007+) xlsx format, with just basic features supported:

- supports PHP 5.2.1+
- takes UTF-8 encoded input
- multiple worksheets
- supports currency/date/numeric cell formatting, simple formulas

Give this library a try, if you find yourself [running out of memory writing spreadsheets with PHPExcel](http://www.zedwood.com/article/php-excel-writer-performance-comparison).

Simple PHP CLI example:

```
$data = array(
    array('year','month','amount'),
    array('2003','1','220'),
    array('2003','2','153.5'),
);

$writer = new XLSXWriter();
$writer->writeSheet($data);
$writer->writeToFile('output.xlsx');
```

Multiple Sheets:

```
$data1 = array(
     array('5','3'),
     array('1','6'),
);
$data2 = array(
     array('2','7','9'),
     array('4','8','0'),
);

$writer = new XLSXWriter();
$writer->setAuthor('Doc Author');
$writer->writeSheet($data1,'Sheet1');
$writer->writeSheet($data2,'Sheet2');
echo $writer->writeToString();
```

Simple/Advanced Cell Formats:

```
//simple formats: date, datetime, integer, dollar, euro, string
$header = array(
  'created'=>'date',
  'product_id'=>'integer',
  'quantity'=>'#,##0',
  'amount'=>'dollar',
  'description'=>'string',
  'tax'=>'[$$-1009]#,##0.00;[RED]-[$$-1009]#,##0.00',
);
$data = array(
    array('2015-01-01',873,1,'44.00','misc','=D2*0.05'),
    array('2015-01-12',324,2,'88.00','none','=D3*0.05'),
);

$writer = new XLSXWriter();
$writer->writeSheet($data,'Sheet1', $header);
$writer->writeToFile('example.xlsx');
```

Load test with 50000 rows: (runs fast, with low memory usage)

```
include_once("xlsxwriter.class.php");
$header = array('c1'=>'string','c2'=>'string','c3'=>'string','c4'=>'string');
$writer = new XLSXWriter();
$writer->writeSheetHeader('Sheet1', $header );//optional
for($i=0; $iwriteSheetRow('Sheet1', array(rand()%10000,rand()%10000,rand()%10000,rand()%10000) );
}
$writer->writeToFile('output.xlsx');
echo '#'.floor((memory_get_peak_usage())/1024/1024)."MB"."\n";
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 76.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~214 days

Total

5

Last Release

3360d ago

Major Versions

0.22 → 1.02017-02-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/24548b753089898f260dfce842f29e7abbeaf606e95ee59b75b1b2f8818c7e4d?d=identicon)[damienlagae](/maintainers/damienlagae)

---

Top Contributors

[![mk-j](https://avatars.githubusercontent.com/u/2347256?v=4)](https://github.com/mk-j "mk-j (46 commits)")[![jpastoor](https://avatars.githubusercontent.com/u/733306?v=4)](https://github.com/jpastoor "jpastoor (3 commits)")[![damienlagae](https://avatars.githubusercontent.com/u/2233003?v=4)](https://github.com/damienlagae "damienlagae (2 commits)")[![sebastiankalwa](https://avatars.githubusercontent.com/u/8233667?v=4)](https://github.com/sebastiankalwa "sebastiankalwa (2 commits)")[![GoktugOzturk](https://avatars.githubusercontent.com/u/1000956?v=4)](https://github.com/GoktugOzturk "GoktugOzturk (2 commits)")[![ShinyChang](https://avatars.githubusercontent.com/u/1590707?v=4)](https://github.com/ShinyChang "ShinyChang (1 commits)")[![EOM](https://avatars.githubusercontent.com/u/1219132?v=4)](https://github.com/EOM "EOM (1 commits)")[![fugi](https://avatars.githubusercontent.com/u/4803401?v=4)](https://github.com/fugi "fugi (1 commits)")[![marktinsley](https://avatars.githubusercontent.com/u/303598?v=4)](https://github.com/marktinsley "marktinsley (1 commits)")[![cgtechconsulting](https://avatars.githubusercontent.com/u/127103055?v=4)](https://github.com/cgtechconsulting "cgtechconsulting (1 commits)")

---

Tags

phplibraryexcelxlsxlsx

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/damienlagae-xlsxwriter/health.svg)

```
[![Health](https://phpackages.com/badges/damienlagae-xlsxwriter/health.svg)](https://phpackages.com/packages/damienlagae-xlsxwriter)
```

###  Alternatives

[mk-j/php_xlsxwriter

PHP Library to write XLSX files

1.9k8.1M27](/packages/mk-j-php-xlsxwriter)[avadim/fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP

2951.2M7](/packages/avadim-fast-excel-writer)[avadim/fast-excel-reader

Lightweight and very fast XLSX Excel Spreadsheet Reader in PHP

104608.4k6](/packages/avadim-fast-excel-reader)[avadim/fast-excel-templator

Lightweight and very fast Excel Spreadsheet generator from XLSX-templates in PHP

20106.6k](/packages/avadim-fast-excel-templator)[maksimovic/php-xlsx-writer

PHP Library to write XLSX files

1143.0k](/packages/maksimovic-php-xlsx-writer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
