PHPackages                             chillerlan/php-qrcode - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. chillerlan/php-qrcode

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chillerlan/php-qrcode
=====================

A QR Code generator and reader with a user-friendly API. PHP 8.4+

6.0.0(2mo ago)2.4k28.9M—8%329[1 issues](https://github.com/chillerlan/php-qrcode/issues)[1 PRs](https://github.com/chillerlan/php-qrcode/pulls)20MITPHPPHP ^8.2CI passing

Since Dec 24Pushed 1mo ago50 watchersCompare

[ Source](https://github.com/chillerlan/php-qrcode)[ Packagist](https://packagist.org/packages/chillerlan/php-qrcode)[ Docs](https://github.com/chillerlan/php-qrcode)[ Fund](https://ko-fi.com/codemasher)[ RSS](/packages/chillerlan-php-qrcode/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (21)Versions (53)Used By (20)

chillerlan/php-qrcode
=====================

[](#chillerlanphp-qrcode)

A PHP QR Code generator based on the [implementation by Kazuhiko Arase](https://github.com/kazuhikoarase/qrcode-generator), namespaced, cleaned up, improved and other stuff.
It also features a QR Code reader based on a [PHP port](https://github.com/khanamiryan/php-qrcode-detector-decoder) of the [ZXing library](https://github.com/zxing/zxing).

**Attention:** there is now also a javascript port on NPM: [@chillerlan/qrcode](https://www.npmjs.com/package/@chillerlan/qrcode).

[![PHP Version Support](https://camo.githubusercontent.com/337669a34b71914466c8ab829cbbebfbd34fb73faae5a3719d0442d0394f5bba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6368696c6c65726c616e2f7068702d7172636f64653f6c6f676f3d70687026636f6c6f723d383839324246266c6f676f436f6c6f723d666666)](https://www.php.net/supported-versions.php)[![Packagist version](https://camo.githubusercontent.com/c7833637f65e1d32fe5bcfb8941bce8391b33913693d04dd673faeaeed620915/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368696c6c65726c616e2f7068702d7172636f64652e7376673f6c6f676f3d7061636b6167697374266c6f676f436f6c6f723d666666)](https://packagist.org/packages/chillerlan/php-qrcode)[![Continuous Integration](https://camo.githubusercontent.com/a56e13e42477268458a8e0fcba84dd6826f1163a6ef2e8168dbfdf8beb7cbb99/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6368696c6c65726c616e2f7068702d7172636f64652f63692e796d6c3f6272616e63683d6d61696e266c6f676f3d676974687562266c6f676f436f6c6f723d666666)](https://github.com/chillerlan/php-qrcode/actions/workflows/ci.yml?query=branch%3Amain)[![CodeCov](https://camo.githubusercontent.com/e942cd3043c8888699aacd24bd350a590af10fc82b37dd836c0c26be7ef986d9/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6368696c6c65726c616e2f7068702d7172636f64652f6d61696e3f6c6f676f3d636f6465636f76266c6f676f436f6c6f723d666666)](https://app.codecov.io/gh/chillerlan/php-qrcode/tree/main)[![Codacy](https://camo.githubusercontent.com/4a6a86791ff82c1013ad7312b25d6f663a3ee8b71aab8ef41f538d57f9b920ea/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f67726164652f65646363666334666535613334623734623163353365653033663039376238642f6d61696e3f6c6f676f3d636f64616379266c6f676f436f6c6f723d666666)](https://app.codacy.com/gh/chillerlan/php-qrcode/dashboard?branch=main)[![Packagist downloads](https://camo.githubusercontent.com/19989bb33cfce8ffdfaae04377fbc62f166d3ad9b0952decdfe8447578fa7159/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6368696c6c65726c616e2f7068702d7172636f64653f6c6f676f3d7061636b6167697374266c6f676f436f6c6f723d666666)](https://packagist.org/packages/chillerlan/php-qrcode/stats)[![Documentation](https://camo.githubusercontent.com/3313ca8ba981adf59a76e91d6abea627ea0cd0e96ccb0639e73e285bf33ee058/68747470733a2f2f696d672e736869656c64732e696f2f72656164746865646f63732f7068702d7172636f64652f6d61696e3f6c6f676f3d72656164746865646f6373266c6f676f436f6c6f723d666666)](https://php-qrcode.readthedocs.io/en/main/)

Overview
========

[](#overview)

Features
--------

[](#features)

- Creation of [Model 2 QR Codes](https://www.qrcode.com/en/codes/model12.html), [Version 1 to 40](https://www.qrcode.com/en/about/version.html)
- [ECC Levels](https://www.qrcode.com/en/about/error_correction.html) L/M/Q/H supported
- Mixed mode support (encoding modes can be combined within a QR symbol). Supported modes:
    - numeric
    - alphanumeric
    - 8-bit binary
        - [ECI support](https://en.wikipedia.org/wiki/Extended_Channel_Interpretation)
    - 13-bit double-byte:
        - kanji (Japanese, Shift-JIS)
        - hanzi (simplified Chinese, GB2312/GB18030) as [defined in GBT18284-2000](https://www.chinesestandard.net/PDF/English.aspx/GBT18284-2000)
- Flexible, easily extensible output modules, built-in support for the following output formats:
    - [GdImage](https://www.php.net/manual/book.image) (raster graphics: avif, bmp, gif, jpeg, png, webp)
    - [ImageMagick](https://www.php.net/manual/book.imagick) ([multiple supported image formats](https://imagemagick.org/script/formats.php))
    - Markup types: SVG, HTML, etc.
    - String types: JSON, plain text, etc.
    - Encapsulated Postscript (EPS)
    - PDF via [FPDF](https://github.com/setasign/fpdf)
- QR Code reader (via GD and ImageMagick)

Requirements
------------

[](#requirements)

- PHP 8.4+
    - [`ext-mbstring`](https://www.php.net/manual/book.mbstring.php)
    - optional:
        - [`ext-gd`](https://www.php.net/manual/book.image) for `QRGdImage` based output
        - [`ext-imagick`](https://github.com/Imagick/imagick) with [ImageMagick](https://imagemagick.org) installed
        - [`ext-fileinfo`](https://www.php.net/manual/book.fileinfo.php) required by `QRImagick` output
        - [`setasign/fpdf`](https://github.com/setasign/fpdf) for the PDF output module
        - [`intervention/image`](https://github.com/Intervention/image) for alternative GD/ImageMagick output

For the QR Code reader, either `ext-gd` or `ext-imagick` is required!

Documentation
=============

[](#documentation)

- The user manual is at  ([sources](https://github.com/chillerlan/php-qrcode/tree/main/docs))
- An API documentation created with [phpDocumentor](https://www.phpdoc.org/) can be found at
- The documentation for the `QROptions` container is here: [chillerlan/php-settings-container](https://github.com/chillerlan/php-settings-container#readme)
- Benchmark results can be found in the [`benchmark` branch](https://github.com/chillerlan/php-qrcode/tree/benchmark/markdown)

**Important: Please use the examples from the branch that matches your installed php-qrcode version ( [v4.x](https://github.com/chillerlan/php-qrcode/tree/v4.3.x/examples), [v5.x](https://github.com/chillerlan/php-qrcode/tree/v5.0.x/examples), [v6.x](https://github.com/chillerlan/php-qrcode/tree/v6.0.x/examples), [dev-main](https://github.com/chillerlan/php-qrcode/tree/main/examples))!**
The `main` (default) branch is the active development for future major versions, and it is most likely incompatible with the latest release versions.

Installation with [composer](https://getcomposer.org)
-----------------------------------------------------

[](#installation-with-composer)

See [the installation guide](https://php-qrcode.readthedocs.io/en/main/Usage/Installation.html) for more info!

### Terminal

[](#terminal)

```
composer require chillerlan/php-qrcode

```

### composer.json

[](#composerjson)

```
{
	"require": {
		"php": "^8.4",
		"chillerlan/php-qrcode": "dev-main#"
	}
}
```

Note: replace `dev-main` with a [version constraint](https://getcomposer.org/doc/articles/versions.md#writing-version-constraints), e.g. `^6.0` - see [releases](https://github.com/chillerlan/php-qrcode/releases) for valid versions.

Quickstart
----------

[](#quickstart)

We want to encode this URI for a mobile authenticator into a QRcode image:

```
$data = 'otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net';

// quick and simple:
echo '';
```

Wait, what was that? Please again, slower! See [Advanced usage](https://php-qrcode.readthedocs.io/en/main/Usage/Advanced-usage.html) in the manual. Also, have a look [in the examples folder](https://github.com/chillerlan/php-qrcode/tree/main/examples) for some more usage examples.

 [![QR codes are awesome!](https://raw.githubusercontent.com/chillerlan/php-qrcode/main/.github/images/example.svg)](https://raw.githubusercontent.com/chillerlan/php-qrcode/main/.github/images/example.svg)

Disclaimer!
===========

[](#disclaimer)

I don't take responsibility for molten CPUs, misled applications, failed log-ins etc.. Use at your own risk!

License notice
--------------

[](#license-notice)

- Parts of this code are [ported to PHP](https://github.com/codemasher/php-qrcode-decoder) from the [ZXing project](https://github.com/zxing/zxing) and licensed under the [Apache License, Version 2.0](./NOTICE).
- [The documentation](https://github.com/chillerlan/php-qrcode/tree/main/docs) is licensed under the [Creative Commons Attribution 4.0 International (CC BY 4.0) License](https://creativecommons.org/licenses/by/4.0/).

Trademark Notice
----------------

[](#trademark-notice)

The word "QR Code" is a registered trademark of *DENSO WAVE INCORPORATED*

###  Health Score

80

—

ExcellentBetter than 100% of packages

Maintenance89

Actively maintained with recent releases

Popularity78

Solid adoption and visibility

Community50

Growing community involvement

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.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 ~62 days

Recently: every ~45 days

Total

49

Last Release

61d ago

Major Versions

4.3.4 → 5.0-beta2023-03-22

4.4.0 → 5.0.02023-11-24

4.4.1 → 5.0.12024-01-07

4.4.2 → 5.0.32024-11-21

v5.0.x-dev → 6.0.02026-03-14

PHP version history (7 changes)2.0.0PHP &gt;=7.0.3

1.0.8PHP &gt;=5.6.0

3.0.0PHP ^7.2

4.0.0PHP ^7.4

4.2.0PHP ^7.4 || ^8.0

3.4.1PHP ^7.2 || ^8.0

6.0.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![codemasher](https://avatars.githubusercontent.com/u/592497?v=4)](https://github.com/codemasher "codemasher (1265 commits)")[![MaximilianKresse](https://avatars.githubusercontent.com/u/545671?v=4)](https://github.com/MaximilianKresse "MaximilianKresse (5 commits)")[![eigan](https://avatars.githubusercontent.com/u/41789?v=4)](https://github.com/eigan "eigan (3 commits)")[![joshstoik1](https://avatars.githubusercontent.com/u/403248?v=4)](https://github.com/joshstoik1 "joshstoik1 (2 commits)")[![jschaedl](https://avatars.githubusercontent.com/u/1880467?v=4)](https://github.com/jschaedl "jschaedl (1 commits)")[![kmvan](https://avatars.githubusercontent.com/u/3839554?v=4)](https://github.com/kmvan "kmvan (1 commits)")[![livingroot](https://avatars.githubusercontent.com/u/9570664?v=4)](https://github.com/livingroot "livingroot (1 commits)")[![SoftCreatR](https://avatars.githubusercontent.com/u/81188?v=4)](https://github.com/SoftCreatR "SoftCreatR (1 commits)")[![Trismegiste](https://avatars.githubusercontent.com/u/1260026?v=4)](https://github.com/Trismegiste "Trismegiste (1 commits)")[![darthmaim](https://avatars.githubusercontent.com/u/2511547?v=4)](https://github.com/darthmaim "darthmaim (1 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (1 commits)")[![GaiusCoffey](https://avatars.githubusercontent.com/u/1902699?v=4)](https://github.com/GaiusCoffey "GaiusCoffey (1 commits)")

---

Tags

imagemagicklet-php5-diephpphp-libraryphp5-is-deadphp7php7-is-deadphp8phpqrcodeqr-codeqr-generatorqr-readerqrcodeqrcode-generatorqrcode-readerqrcode-scannersvgqr codeqrcodeqrphpqrcodeqrcode-generatorqrcode-readerqr-reader

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/chillerlan-php-qrcode/health.svg)

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

###  Alternatives

[endroid/qr-code

Endroid QR Code

4.8k67.6M348](/packages/endroid-qr-code)[amirezaeb/heroqr

A Powerful QR Code Management Library For PHP

9510.3k](/packages/amirezaeb-heroqr)[arcanedev/qr-code

QR Code generator

1231.9k1](/packages/arcanedev-qr-code)[devtical/nova-qrcode-field

Nova QR code field

4560.6k2](/packages/devtical-nova-qrcode-field)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

295.1k](/packages/linkxtr-laravel-qrcode)[akira/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

431.4k](/packages/akira-laravel-qrcode)

PHPackages © 2026

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