PHPackages                             viest/xlswriter - 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. viest/xlswriter

ActivePhp-ext[PDF &amp; Document Generation](/categories/documents)

viest/xlswriter
===============

xlswriter is a PHP C Extension that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.

v2.0.3(2w ago)2.4k91236[5 issues](https://github.com/viest/php-ext-xlswriter/issues)BSD-2-ClauseCPHP &gt;= 7.0CI passing

Since May 16Pushed 2w ago36 watchersCompare

[ Source](https://github.com/viest/php-ext-xlswriter)[ Packagist](https://packagist.org/packages/viest/xlswriter)[ Fund](https://opencollective.com/php-ext-xlswriter)[ RSS](/packages/viest-xlswriter/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)DependenciesVersions (5)Used By (0)

[![php-ext-xlswriter](resource/logo_now.png)](resource/logo_now.png)

[![php-ext-xlswriter](https://camo.githubusercontent.com/bb7d81da7539ae906096150e6c0ca6682ecde21b7f6a24139eb0a0bc9cf0e6e9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f76696573742f7068702d6578742d657863656c2d6578706f72742e737667)](https://github.com/viest/php-ext-xlswriter/releases)

[![php-ext-xlswriter](https://camo.githubusercontent.com/ffe1f5837ed0661e7d081081868978e02e2fdc8f74fd382c7c00d6712caf045d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6d61636f732532302537432532306c696e757825323025374325323077696e646f77732d627269676874677265656e2e737667)](https://github.com/viest/php-ext-xlswriter)

[![php-ext-xlswriter](https://camo.githubusercontent.com/8ebea64086cbb6d1145a60f5fef171bf9a0842bebe8989c44c6be4c2e84c2683/68747470733a2f2f67697465652e636f6d2f76696573742f7068702d6578742d786c737772697465722f62616467652f737461722e7376673f7468656d653d677670)](https://gitee.com/viest/php-ext-xlswriter)[![php-ext-xlswriter](https://camo.githubusercontent.com/8d45f2c21c54b159f46f561a386b00143e91883b70c8a08d8121183402982752/68747470733a2f2f676974636f64652e636f6d2f76696573742f7068702d6578742d786c73787772697465722f737461722f62616467652e737667)](https://gitcode.com/viest/php-ext-xlsxwriter)

[![php-ext-xlswriter](https://camo.githubusercontent.com/278307252db537d5cf8848d00198ea5986bb1c1a3fe1bc166f8852328e60b75b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f76696573742f7068702d6578742d786c737772697465722f6d61696e2e796d6c3f6272616e63683d6d6173746572266c6f676f3d676974687562)](https://github.com/viest/php-ext-xlswriter/actions)[![php-ext-xlswriter](https://camo.githubusercontent.com/315e70afbc1328d686a8ef853f7dd345632c99c145201fc51ec3f96749b38f64/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f773463666a6f3965346773727336726e2f6272616e63682f6d61737465723f7376673d74727565)](https://ci.appveyor.com/project/viest/php-ext-xlswriter/branch/master)[![php-ext-xlswriter](https://camo.githubusercontent.com/0f9c00af68d4f83db09d8178a3021c492405ccbcbd01e26e0d0be3763d5fcc3c/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d25324676696573742532467068702d6578742d786c737772697465722e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bgithub.com%2Fviest%2Fphp-ext-xlswriter?ref=badge_shield)

[![php-ext-xlswriter](https://camo.githubusercontent.com/86bd6c22cacbc28a2fcbf4c61cba675c47799269e2e128cfaa2bdc6013597adc/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f616c6c2f62616467652e7376673f6c6162656c3d66696e616e6369616c2b636f6e7472696275746f7273)](https://opencollective.com/php-ext-xlswriter)[![php-ext-xlswriter](https://camo.githubusercontent.com/4226c9c8b62bd44b0e95de95d201197f5196e1b78e8d771841a1d7b0ad98447f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344253230372e302d627269676874677265656e2e737667)](https://github.com/viest/php-ext-xlswriter)[![php-ext-xlswriter](https://camo.githubusercontent.com/a062e24003fb19828d278935f6f1bfc0dd465f85a6ffbb082529f0ed14474df3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f76696573742f7068702d6578742d657863656c2d6578706f72742e737667)](https://github.com/viest/php-ext-xlswriter)[![php-ext-xlswriter](https://camo.githubusercontent.com/915f87e956ba1ba46b605760796f97aaf2af77b571424e3a0cb4566f9bd9ee9d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442d677265656e2e737667)](https://github.com/viest/php-ext-xlswriter)[![php-ext-xlswriter](https://camo.githubusercontent.com/1cf53e95c56aefc20a23debea335a0f26f720e555b732c60b0d3b97fb1967d00/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f76696573742f7068702d6578742d657863656c2d6578706f72742e737667)](https://github.com/viest/php-ext-xlswriter)

Why use xlswriter
-----------------

[](#why-use-xlswriter)

The chart below compares xlswriter with PhpSpreadsheet (the maintained successor to PHPExcel) when exporting an XLSX file, scaled all the way to Excel's row limit. Writing 1,048,576 rows × 10 columns, xlswriter is about 20× faster, and its fixed-memory mode keeps peak memory flat at ~30 MB no matter how many rows you write — whereas a pure-PHP library's memory grows with the data (≈7 GB for the same file).

[![xlswriter vs PhpSpreadsheet performance](resource/performance_comparison.png)](resource/performance_comparison.png)

> The two xlswriter modes track within ~10% of each other on time. Fixed-memory mode is marginally faster because it streams each row straight to disk and frees it immediately — a single pass, with no full in-memory model to build up and then serialize a second time at the end. The trade-off is that, unlike normal mode, it can no longer revisit a cell once it has been written (and its strings are stored inline rather than de-duplicated, so the file can be slightly larger). Normal mode keeps the whole workbook in memory, which is what lets you write cells in any order and re-style them before saving.

xlswriter is a PHP C Extension for Excel 2007+ XLSX files. It writes text, numbers, formulas, dates, charts, images and hyperlinks to new workbooks, opens existing files to edit them and save the result, reads their contents back, and evaluates formulas to a computed value. It supports features such as:

###### Writer

[](#writer)

- 100% compatible Excel XLSX files.
- Full Excel formatting.
- Merged cells.
- Defined names.
- Autofilters.
- Charts.
- Data validation and drop down lists.
- Conditional formatting.
- Rich text, comments and hyperlinks.
- Worksheet PNG/JPEG images.
- Edit existing workbooks — open a file, update cell values, styles, merged ranges and row/column sizes, add worksheets, images and charts, then save the result.
- Formula calculation — evaluate a formula and get its computed value, and write formulas with a pre-computed cached result.
- Memory optimization mode for writing large files.
- Works on Linux, FreeBSD, OpenBSD, OS X, Windows.
- Compiles for 32 and 64 bit.
- FreeBSD License.
- The only dependency is on zlib.

###### Reader

[](#reader)

- Full read mode and cursor read mode.
- Read by data type.
- Read cell styles and number formats.
- Read merged cells.
- Read images, charts and comments.
- Read formulas together with their cached values.

#### Install

[](#install)

###### Unix

[](#unix)

xlswriter requires the zlib development headers at build time. Install them first if they are missing (common on minimal images):

```
# Debian / Ubuntu
apt-get install -y zlib1g-dev
# Alpine
apk add zlib-dev
# RHEL / CentOS / Fedora
yum install -y zlib-devel
```

```
pecl install xlswriter
```

###### Windows

[](#windows)

[download dll](https://github.com/viest/php-ext-xlswriter/releases)

#### Benchmark

[](#benchmark)

Test environment: Macbook Pro 13 inch, Intel Core i5, 16GB 2133MHz LPDDR3 Memory, 128GB SSD Storage.

##### Export

[](#export)

> Two memory modes export 1 million rows of data (27 columns, data is string)

- Normal mode: only 29S is needed, and the memory only needs 2083MB;
- Fixed memory mode: only need 52S, memory only needs &lt;1MB;

##### Import

[](#import)

> 1 million rows of data (1 columns, data is inter)

- Full mode: Just 3S, the memory is only 558MB;
- Cursor mode: Just 2.8S, memory is only &lt;1MB;

[Documents](https://xlswriter-docs.viest.me/)
---------------------------------------------

[](#documents)

Includes extensive and detailed instructions that make it easy to get started with xlswriter.

PECL Repository
---------------

[](#pecl-repository)

[![pecl](resource/pecl.png)](https://pecl.php.net/package/xlswriter)

IDE Helper
----------

[](#ide-helper)

```
composer require viest/php-ext-xlswriter-ide-helper:dev-master
```

Contributors
------------

[](#contributors)

### Code Contributors

[](#code-contributors)

This project exists thanks to all the people who contribute. \[[Contribute](CONTRIBUTING.md)\]. [![](https://camo.githubusercontent.com/a84e8f11f73bc87c96ca290189274dfbbfead817276178bf1e5efa4d7f4ffc3e/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f636f6e7472696275746f72732e7376673f77696474683d38393026627574746f6e3d66616c7365)](https://github.com/viest/php-ext-xlswriter/graphs/contributors)

### Financial Contributors

[](#financial-contributors)

Become a financial contributor and help us sustain our community. \[[Contribute](https://opencollective.com/php-ext-xlswriter/contribute)\]

#### Individuals

[](#individuals)

[![](https://camo.githubusercontent.com/02883a925e75c781fd59e6e11942f8a855dd3e4afa4076ccc5dad3de767ddbb6/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f696e646976696475616c732e7376673f77696474683d383930)](https://opencollective.com/php-ext-xlswriter)

#### Organizations

[](#organizations)

Support this project with your organization. Your logo will show up here with a link to your website. \[[Contribute](https://opencollective.com/php-ext-xlswriter/contribute)\]

[![](https://camo.githubusercontent.com/c339328c23ee3162fcbb8c9bd5182bed63e2b4b35c5c47cd2c6940b2680b95ce/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f6f7267616e697a6174696f6e2f302f6176617461722e737667)](https://opencollective.com/php-ext-xlswriter/organization/0/website)[![](https://camo.githubusercontent.com/30a4eb95aa68b02c225208706322a2db53f01b2ad9166990eee12fd681677529/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f6f7267616e697a6174696f6e2f312f6176617461722e737667)](https://opencollective.com/php-ext-xlswriter/organization/1/website)[![](https://camo.githubusercontent.com/0430acaf464800cf9841da66f1d9ff83d2c1d0744a59c105ffe79d0a82e46508/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f6f7267616e697a6174696f6e2f322f6176617461722e737667)](https://opencollective.com/php-ext-xlswriter/organization/2/website)[![](https://camo.githubusercontent.com/e0e6c2a0048fe46cf503a44abaed53da666c33cb704a2b73ca49bb66ac2dd253/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f6f7267616e697a6174696f6e2f332f6176617461722e737667)](https://opencollective.com/php-ext-xlswriter/organization/3/website)[![](https://camo.githubusercontent.com/2c6e1878c01ad97fa594588f04be90ae37b99aeb2bbfe6e608dd5985e7040ff1/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f6f7267616e697a6174696f6e2f342f6176617461722e737667)](https://opencollective.com/php-ext-xlswriter/organization/4/website)[![](https://camo.githubusercontent.com/3b75ce76e74d581ba88ed89fc9e875a8cdfdda2b24f3394ae664c2c06869c020/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f6f7267616e697a6174696f6e2f352f6176617461722e737667)](https://opencollective.com/php-ext-xlswriter/organization/5/website)[![](https://camo.githubusercontent.com/a40b1a10008d348a7882845471c7a646ba07d3bad9e27e1ee6bddcd562765d31/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f6f7267616e697a6174696f6e2f362f6176617461722e737667)](https://opencollective.com/php-ext-xlswriter/organization/6/website)[![](https://camo.githubusercontent.com/8b99ed867cfce4d7ab0b4e27fed900c5f53b436460c8b127a20924219615921e/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f6f7267616e697a6174696f6e2f372f6176617461722e737667)](https://opencollective.com/php-ext-xlswriter/organization/7/website)[![](https://camo.githubusercontent.com/4a022241769f023774e5c1e83615cf35d893eb1e458d0dde4ed4003607fff9f5/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f6f7267616e697a6174696f6e2f382f6176617461722e737667)](https://opencollective.com/php-ext-xlswriter/organization/8/website)[![](https://camo.githubusercontent.com/e08bded3f4f603568cdcf4a150b8e5e2276cd91b759e8c6d992224f42f65a56b/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7068702d6578742d786c737772697465722f6f7267616e697a6174696f6e2f392f6176617461722e737667)](https://opencollective.com/php-ext-xlswriter/organization/9/website)

License
-------

[](#license)

BSD License

[![FOSSA Status](https://camo.githubusercontent.com/0040fe7f22299ed6c728d34f09f1323c135043f28586bb5b0840929488e6d159/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d25324676696573742532467068702d6578742d786c737772697465722e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bgithub.com%2Fviest%2Fphp-ext-xlswriter?ref=badge_large)

Stargazers over time
--------------------

[](#stargazers-over-time)

[![Stargazers over time](https://camo.githubusercontent.com/b57a7209323eb2832272475717d4dae12ade548cf704e3715f344fcccaf3c127/68747470733a2f2f7374617263686172742e63632f76696573742f7068702d6578742d786c737772697465722e737667)](https://starchart.cc/viest/php-ext-xlswriter)

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance96

Actively maintained with recent releases

Popularity42

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 92.6% 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 ~9 days

Total

4

Last Release

19d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14308107?v=4)[viest](/maintainers/Viest)[@viest](https://github.com/viest)

---

Top Contributors

[![viest](https://avatars.githubusercontent.com/u/14308107?v=4)](https://github.com/viest "viest (737 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (30 commits)")[![motecshine](https://avatars.githubusercontent.com/u/7615270?v=4)](https://github.com/motecshine "motecshine (5 commits)")[![petk](https://avatars.githubusercontent.com/u/1614009?v=4)](https://github.com/petk "petk (4 commits)")[![stramunin](https://avatars.githubusercontent.com/u/1451700?v=4)](https://github.com/stramunin "stramunin (3 commits)")[![gyalogmixi](https://avatars.githubusercontent.com/u/33487866?v=4)](https://github.com/gyalogmixi "gyalogmixi (3 commits)")[![HergenD](https://avatars.githubusercontent.com/u/32772820?v=4)](https://github.com/HergenD "HergenD (2 commits)")[![HaiD84](https://avatars.githubusercontent.com/u/2562280?v=4)](https://github.com/HaiD84 "HaiD84 (2 commits)")[![hughcube](https://avatars.githubusercontent.com/u/5361789?v=4)](https://github.com/hughcube "hughcube (2 commits)")[![weltling](https://avatars.githubusercontent.com/u/22016?v=4)](https://github.com/weltling "weltling (1 commits)")[![dunglas](https://avatars.githubusercontent.com/u/57224?v=4)](https://github.com/dunglas "dunglas (1 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")[![molinchenxi](https://avatars.githubusercontent.com/u/26620861?v=4)](https://github.com/molinchenxi "molinchenxi (1 commits)")[![monkeywithacupcake](https://avatars.githubusercontent.com/u/7316730?v=4)](https://github.com/monkeywithacupcake "monkeywithacupcake (1 commits)")[![sergeyklay](https://avatars.githubusercontent.com/u/1256298?v=4)](https://github.com/sergeyklay "sergeyklay (1 commits)")[![sy-records](https://avatars.githubusercontent.com/u/33931153?v=4)](https://github.com/sy-records "sy-records (1 commits)")[![arshidkv12](https://avatars.githubusercontent.com/u/6806645?v=4)](https://github.com/arshidkv12 "arshidkv12 (1 commits)")

---

Tags

dllexcelexcel-exportexcelwriterextensionlaravellibxlsxwriterpeclphalconphpswoolexlswriterxlsxxlsx-filesxlsx-writerxlsxreaderxlsxwriter

### Embed Badge

![Health badge](/badges/viest-xlswriter/health.svg)

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

###  Alternatives

[tarfin-labs/easy-pdf

Makes pdf processing easy.

1719.9k](/packages/tarfin-labs-easy-pdf)

PHPackages © 2026

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