chillerlan/php-qrcode

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

PHP

2,391

1,292 commits

updated Aug 31, 2026

See the code

README

chillerlan/php-qrcode

A PHP QR Code generator based on the implementation by Kazuhiko Arase, namespaced, cleaned up, improved and other stuff. It also features a QR Code reader based on a PHP port of the ZXing library.

Attention: there is now also a javascript port on NPM: @chillerlan/qrcode.

PHP Version Support Packagist version Continuous Integration CodeCov Codacy Packagist downloads Documentation

Overview

Features

  • Creation of Model 2 QR Codes, Version 1 to 40
  • ECC Levels L/M/Q/H supported
  • Mixed mode support (encoding modes can be combined within a QR symbol). Supported modes:
  • Flexible, easily extensible output modules, built-in support for the following output formats:
  • QR Code reader (via GD and ImageMagick)

Requirements

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

Documentation

Important: Please use the examples from the branch that matches your installed php-qrcode version ( v5.x, v6.x, dev-main )!
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

See the installation guide for more info!

Terminal

composer require chillerlan/php-qrcode

composer.json

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

Note: replace dev-main with a version constraint, e.g. ^6.0 - see releases for valid versions.

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 '<img src="'.(new QRCode)->render($data).'" alt="QR Code" />';

Wait, what was that? Please again, slower! See Advanced usage in the manual. Also, have a look in the examples folder for some more usage examples.

QR codes are awesome!

Disclaimer!

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

License notice

Trademark Notice

The word "QR Code" is a registered trademark of DENSO WAVE INCORPORATED
https://www.qrcode.com/en/faq.html#patentH2Title

Anti clanker clause

If your issue reports and pull requests are LLM generated, keep them. I'll prefer to keep my bugs then. I don't want anything to do with the water guzzling, air polluting, brain cooking, confidently lying fascist plagiarism machines. Use your human brain and hands instead.

imagemagick
let-php5-die
php
php5-is-dead
php7
php7-is-dead
php8
php-library
phpqrcode
qr-code
qrcode
qrcode-generator
qrcode-reader
qrcode-scanner
qr-generator
qr-reader
svg

chillerlan/php-qrcode

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

PHP

2,391

1,292 commits

updated Aug 31, 2026

See the code

README

chillerlan/php-qrcode

A PHP QR Code generator based on the implementation by Kazuhiko Arase, namespaced, cleaned up, improved and other stuff. It also features a QR Code reader based on a PHP port of the ZXing library.

Attention: there is now also a javascript port on NPM: @chillerlan/qrcode.

PHP Version Support Packagist version Continuous Integration CodeCov Codacy Packagist downloads Documentation

Overview

Features

  • Creation of Model 2 QR Codes, Version 1 to 40
  • ECC Levels L/M/Q/H supported
  • Mixed mode support (encoding modes can be combined within a QR symbol). Supported modes:
  • Flexible, easily extensible output modules, built-in support for the following output formats:
  • QR Code reader (via GD and ImageMagick)

Requirements

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

Documentation

Important: Please use the examples from the branch that matches your installed php-qrcode version ( v5.x, v6.x, dev-main )!
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

See the installation guide for more info!

Terminal

composer require chillerlan/php-qrcode

composer.json

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

Note: replace dev-main with a version constraint, e.g. ^6.0 - see releases for valid versions.

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 '<img src="'.(new QRCode)->render($data).'" alt="QR Code" />';

Wait, what was that? Please again, slower! See Advanced usage in the manual. Also, have a look in the examples folder for some more usage examples.

QR codes are awesome!

Disclaimer!

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

License notice

Trademark Notice

The word "QR Code" is a registered trademark of DENSO WAVE INCORPORATED
https://www.qrcode.com/en/faq.html#patentH2Title

Anti clanker clause

If your issue reports and pull requests are LLM generated, keep them. I'll prefer to keep my bugs then. I don't want anything to do with the water guzzling, air polluting, brain cooking, confidently lying fascist plagiarism machines. Use your human brain and hands instead.

imagemagick
let-php5-die
php
php5-is-dead
php7
php7-is-dead
php8
php-library
phpqrcode
qr-code
qrcode
qrcode-generator
qrcode-reader
qrcode-scanner
qr-generator
qr-reader
svg

Project health

Overall

2.8/10

Maintained

5/10

Code review

0/10
OpenSSF Scorecard

Significant stargazers

Andreas Möller

660 followers · starred Oct 2022

Helmut K. C. Tessarek

190 followers · starred Sep 2018

Tom Herrmann

389 followers · starred Sep 2026

Ellis Hoag

25 followers · starred Jan 2018