PHPackages                             hinablue/php\_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. hinablue/php\_xlsxwriter

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

hinablue/php\_xlsxwriter
========================

PHP Library to write XLSX files

0.40(3mo ago)0608↓100%MITPHPPHP &gt;=5.2.1

Since Oct 23Pushed 3mo agoCompare

[ Source](https://github.com/hinablue/PHP_XLSXWriter)[ Packagist](https://packagist.org/packages/hinablue/php_xlsxwriter)[ Docs](https://github.com/hinablue/PHP_XLSXWriter)[ RSS](/packages/hinablue-php-xlsxwriter/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (13)Used By (0)

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

[](#php_xlsxwriter)

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

It is designed to output an Excel compatible spreadsheet in (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
- supports basic cell styling
- supports writing huge 100K+ row spreadsheets

[Never run out of memory with PHPExcel again](https://github.com/mk-j/PHP_XLSXWriter).

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');
```

Simple/Advanced Cell Formats:

```
$header = array(
  'created'=>'date',
  'product_id'=>'integer',
  'quantity'=>'#,##0',
  'amount'=>'price',
  '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->writeSheetHeader('Sheet1', $header );
foreach($data as $row)
	$writer->writeSheetRow('Sheet1', $row );
$writer->writeToFile('example.xlsx');
```

50000 rows: (1.4s, 0MB memory usage)

```
include_once("xlsxwriter.class.php");
$writer = new XLSXWriter();
$writer->writeSheetHeader('Sheet1', array('c1'=>'integer','c2'=>'integer','c3'=>'integer','c4'=>'integer') );
for($i=0; $iwriteSheetRow('Sheet1', array($i, $i+1, $i+2, $i+3) );
}
$writer->writeToFile('huge.xlsx');
echo '#'.floor((memory_get_peak_usage())/1024/1024)."MB"."\n";
```

rowstimememory500001.4s0MB1000002.7s0MB1500004.1s0MB2000005.7s0MB2500007.0s0MBSimple cell formats map to more advanced cell formats

simple formatsformat codestring@integer0dateYYYY-MM-DDdatetimeYYYY-MM-DD HH:MM:SStimeHH:MM:SSprice\#,##0.00dollar\[$$-1009\]#,##0.00;\[RED\]-\[$$-1009\]#,##0.00euro\#,##0.00 \[$€-407\];\[RED\]-#,##0.00 \[$€-407\]Basic cell styles have been available since version 0.30

styleallowed valuesfontArial, Times New Roman, Courier New, Comic Sans MSfont-size8,9,10,11,12 ...font-stylebold, italic, underline, strikethrough or multiple ie: 'bold,italic'borderleft, right, top, bottom, or multiple ie: 'top,left'border-stylethin, medium, thick, dashDot, dashDotDot, dashed, dotted, double, hair, mediumDashDot, mediumDashDotDot, mediumDashed, slantDashDotborder-color\#RRGGBB, ie: #ff99cc or #f9ccolor\#RRGGBB, ie: #ff99cc or #f9cfill\#RRGGBB, ie: #eeffee or #efehaligngeneral, left, right, justify, centervalignbottom, center, distributed

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance79

Regular maintenance activity

Popularity14

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.8% 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 ~405 days

Recently: every ~756 days

Total

11

Last Release

109d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c3b5fb89e323eab2d9d98e45eb5b35f6315f04db95611f595299b2f54c07aca?d=identicon)[hinablue](/maintainers/hinablue)

---

Top Contributors

[![mk-j](https://avatars.githubusercontent.com/u/2347256?v=4)](https://github.com/mk-j "mk-j (127 commits)")[![Radstake](https://avatars.githubusercontent.com/u/1010097?v=4)](https://github.com/Radstake "Radstake (13 commits)")[![andrewkesper](https://avatars.githubusercontent.com/u/14990339?v=4)](https://github.com/andrewkesper "andrewkesper (5 commits)")[![ivanbarlog](https://avatars.githubusercontent.com/u/2583610?v=4)](https://github.com/ivanbarlog "ivanbarlog (3 commits)")[![jpastoor](https://avatars.githubusercontent.com/u/733306?v=4)](https://github.com/jpastoor "jpastoor (3 commits)")[![fulgurio](https://avatars.githubusercontent.com/u/1696131?v=4)](https://github.com/fulgurio "fulgurio (2 commits)")[![sebastiankalwa](https://avatars.githubusercontent.com/u/8233667?v=4)](https://github.com/sebastiankalwa "sebastiankalwa (2 commits)")[![c-schmitz](https://avatars.githubusercontent.com/u/1364282?v=4)](https://github.com/c-schmitz "c-schmitz (2 commits)")[![GoktugOzturk](https://avatars.githubusercontent.com/u/1000956?v=4)](https://github.com/GoktugOzturk "GoktugOzturk (2 commits)")[![lewa](https://avatars.githubusercontent.com/u/11783450?v=4)](https://github.com/lewa "lewa (1 commits)")[![lieszkol](https://avatars.githubusercontent.com/u/16566226?v=4)](https://github.com/lieszkol "lieszkol (1 commits)")[![lourdas](https://avatars.githubusercontent.com/u/397916?v=4)](https://github.com/lourdas "lourdas (1 commits)")[![Malvineous](https://avatars.githubusercontent.com/u/171656?v=4)](https://github.com/Malvineous "Malvineous (1 commits)")[![marktinsley](https://avatars.githubusercontent.com/u/303598?v=4)](https://github.com/marktinsley "marktinsley (1 commits)")[![ShinyChang](https://avatars.githubusercontent.com/u/1590707?v=4)](https://github.com/ShinyChang "ShinyChang (1 commits)")[![stephane-rouleau](https://avatars.githubusercontent.com/u/27228998?v=4)](https://github.com/stephane-rouleau "stephane-rouleau (1 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (1 commits)")[![unamatasanatarai](https://avatars.githubusercontent.com/u/3831251?v=4)](https://github.com/unamatasanatarai "unamatasanatarai (1 commits)")[![xrobau](https://avatars.githubusercontent.com/u/457798?v=4)](https://github.com/xrobau "xrobau (1 commits)")[![EOM](https://avatars.githubusercontent.com/u/1219132?v=4)](https://github.com/EOM "EOM (1 commits)")

---

Tags

phplibraryexcelxlsxlsx

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mk-j/php_xlsxwriter

PHP Library to write XLSX files

1.9k7.9M20](/packages/mk-j-php-xlsxwriter)[avadim/fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP

2911.1M5](/packages/avadim-fast-excel-writer)[avadim/fast-excel-reader

Lightweight and very fast XLSX Excel Spreadsheet Reader in PHP

103568.0k3](/packages/avadim-fast-excel-reader)[avadim/fast-excel-templator

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

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

PHP Library to write XLSX files

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

PHPackages © 2026

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