PHPackages                             maksimovic/php-xlsx-writer - 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. maksimovic/php-xlsx-writer

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

maksimovic/php-xlsx-writer
==========================

PHP Library to write XLSX files

1.0.5(2mo ago)1143.0k↓13.7%1MITPHPPHP ^7.2 | ^8.0CI passing

Since Oct 23Pushed 2mo ago1 watchersCompare

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

READMEChangelog (6)Dependencies (2)Versions (24)Used By (0)

This is a fork of `mk-j/php_xlsxwriter` compatible with PHP versions:

- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4
- 8.5

[![codecov](https://camo.githubusercontent.com/7011e71baa7eb00f060f906183b67a0b37d308019aa7b8fc8b7a390bbda1177b/68747470733a2f2f636f6465636f762e696f2f6769746875622f6d616b73696d6f7669632f5048505f584c53585772697465722f67726170682f62616467652e7376673f746f6b656e3d584b68766a4555415a51)](https://codecov.io/github/maksimovic/PHP_XLSXWriter)[![master](https://github.com/maksimovic/PHP_XLSXWriter/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/maksimovic/PHP_XLSXWriter/actions/workflows/ci.yml/badge.svg?branch=master)

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

[](#php_xlsxwriter)

Installation: `composer require maksimovic/php-xlsx-writer`

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+ 7.2+ and 8.0+
- 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)

```
$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

59

—

FairBetter than 99% of packages

Maintenance87

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 60.2% 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 ~259 days

Recently: every ~231 days

Total

17

Last Release

67d ago

Major Versions

0.39 → 1.0.02023-09-01

PHP version history (2 changes)0.30PHP &gt;=5.2.1

1.0.0PHP ^7.2 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d43e10a649dca578689bc02aa4089e26c0d26b1a2f3640dda458973e55adcf10?d=identicon)[maksimovic](/maintainers/maksimovic)

---

Top Contributors

[![mk-j](https://avatars.githubusercontent.com/u/2347256?v=4)](https://github.com/mk-j "mk-j (127 commits)")[![maksimovic](https://avatars.githubusercontent.com/u/1126226?v=4)](https://github.com/maksimovic "maksimovic (34 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)")[![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)")[![sebastiankalwa](https://avatars.githubusercontent.com/u/8233667?v=4)](https://github.com/sebastiankalwa "sebastiankalwa (2 commits)")[![fulgurio](https://avatars.githubusercontent.com/u/1696131?v=4)](https://github.com/fulgurio "fulgurio (2 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/maksimovic-php-xlsx-writer/health.svg)

```
[![Health](https://phpackages.com/badges/maksimovic-php-xlsx-writer/health.svg)](https://phpackages.com/packages/maksimovic-php-xlsx-writer)
```

###  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)

PHPackages © 2026

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