PHPackages                             wazaari/barcodes - 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. wazaari/barcodes

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

wazaari/barcodes
================

Barcode generator for PHP supporting 20+ barcode types

v0.1(10y ago)16.2k11MITPHP

Since Dec 22Pushed 10y ago1 watchersCompare

[ Source](https://github.com/waza-ari/barcodes)[ Packagist](https://packagist.org/packages/wazaari/barcodes)[ RSS](/packages/wazaari-barcodes/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (1)

[![Latest Stable Version](https://camo.githubusercontent.com/047106dccd72613f63b5aec8539591df8a3f295a5d9996f5a4c65b51387f0dab/68747470733a2f2f706f7365722e707567782e6f72672f746b6c6f766574742f626172636f6465732f762f737461626c652e737667)](https://packagist.org/packages/tklovett/barcodes)[![Total Downloads](https://camo.githubusercontent.com/f59a99f9d810d6c1c7455ead5345f61c2501ce741e026ba4094fadf9cf21e49f/68747470733a2f2f706f7365722e707567782e6f72672f746b6c6f766574742f626172636f6465732f646f776e6c6f6164732e737667)](https://packagist.org/packages/tklovett/barcodes)[![Build Status](https://camo.githubusercontent.com/062d4ec9048ed7fc2c7da0f9b4218bbd0bff159e5b7b7cec56ebe95c56fc06b9/68747470733a2f2f7472617669732d63692e6f72672f746b6c6f766574742f626172636f6465732e737667)](https://travis-ci.org/tklovett/barcodes)[![Coverage Status](https://camo.githubusercontent.com/413dc24bb43d6b19ffcd4bd8f2afe203ffe8bb92d7c3458f2c388780c66f27f8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f746b6c6f766574742f626172636f6465732f62616467652e737667)](https://coveralls.io/r/tklovett/barcodes)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b3b1338d9cb4c25f0b845d051df8875408c2947ad3ceeac9af29e67871b7c4a9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746b6c6f766574742f626172636f6465732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tklovett/barcodes/?branch=master)

[Read More Wiki](https://github.com/tklovett/barcodes/wiki)

Barcodes
========

[](#barcodes)

*Generating barcodes in PHP since 2015!*

Generates HTML, PNG, or SVG canvas

Supported Barcode Types
-----------------------

[](#supported-barcode-types)

### One Dimensional

[](#one-dimensional)

- Codabar
- Code 11
- Code 39 (also extended and/or with check-digit)
- Code 93
- Code 128 (A, B, C, or Auto)
- EAN (2, 5, 13)
- Intelligent Mail
- Interleave 2 of 5
- MSI (also with check-digit)
- Pharmacode
- POSTNET (or PLANET)
- RMS4CC (or KIX)
- Standard 2 of 5 (also with check-digit)
- UPC (A, E)

### Two Dimensional

[](#two-dimensional)

- DataMatrix
- PDF417
- QR Code

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

[](#requirements)

- Barcodes requires ImageMagick to create PNGs in PHP 5.3.
- Barcodes requires PHP bcmath extension for Intelligent Mail barcodes

Installation
------------

[](#installation)

You can install this package with the Composer CLI:

```
composer require tklovett/barcodes

```

Or manually add the dependency to your project's `composer.json`:

```
"require": {
    "tklovett/barcodes": "dev-master"
}

```

And tell composer to install it:

```
composer install

```

Usage
-----

[](#usage)

First instantiate a BarcodeGenerator factory:

```
$generator = new BarcodeGenerator();
```

Then tell it to generate the barcode type of your choice for your code:

```
$barcode = generator.generate(BarcodeType::QR_CODE, "This is what I want encoded");
```

Finally, output SVG, HTML, or a PNG:

```
$svg  = $barcode.toSVG();
$html = $barcode.toHTML();
$png  = $barcode.toPNG();
```

Need a custom height, width, or color for your barcode? No problem:

```
$width = 20;
$height = 30;
$color = 'blue';
$sizedSVG  = $barcode.toSVG($width, $height, $color);
$sizedHTML = $barcode.toSVG($width, $height, $color);
$sizedPNG  = $barcode.toSVG($width, $height, $color);
```

TODO:
-----

[](#todo)

- Convert snake\_case method names to camelCase
- Replace returns from barcode constructors with exception throws
- Write tests
- Write docs
- parent::\_\_construct($code); in all barcodes
- remove unused methods

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% 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

Unknown

Total

1

Last Release

3847d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4508976?v=4)[Daniel Herrmann](/maintainers/waza-ari)[@waza-ari](https://github.com/waza-ari)

---

Top Contributors

[![dineshrabara](https://avatars.githubusercontent.com/u/1228130?v=4)](https://github.com/dineshrabara "dineshrabara (36 commits)")[![tklovett](https://avatars.githubusercontent.com/u/1190849?v=4)](https://github.com/tklovett "tklovett (11 commits)")[![nWidart](https://avatars.githubusercontent.com/u/882397?v=4)](https://github.com/nWidart "nWidart (4 commits)")[![tlovett-rmn](https://avatars.githubusercontent.com/u/8631888?v=4)](https://github.com/tlovett-rmn "tlovett-rmn (2 commits)")[![swvjeff](https://avatars.githubusercontent.com/u/559092?v=4)](https://github.com/swvjeff "swvjeff (1 commits)")[![KennedyTedesco](https://avatars.githubusercontent.com/u/999232?v=4)](https://github.com/KennedyTedesco "KennedyTedesco (1 commits)")[![waza-ari](https://avatars.githubusercontent.com/u/4508976?v=4)](https://github.com/waza-ari "waza-ari (1 commits)")

---

Tags

qr codeqrcodegeneratordatamatrixpdf417barcodesbarcodeeanCODABARCODE 39CODE 128

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wazaari-barcodes/health.svg)

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

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k14.4M55](/packages/milon-barcode)[bitgrave/barcode-bundle

provide barcode rendering service into your Symfony2 application.

24447.2k1](/packages/bitgrave-barcode-bundle)[jucksearm/php-barcode

Barcode Generation Package inspired by Nicola Asuni.

12390.2k1](/packages/jucksearm-php-barcode)[bitgrave/barcode-generator

simple barcode generator base classes supporting 2d- and datamatrix barcodes

1313.7k](/packages/bitgrave-barcode-generator)

PHPackages © 2026

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