PHPackages                             tecnickcom/tc-lib-barcode - 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. [Image &amp; Media](/categories/media)
4. /
5. tecnickcom/tc-lib-barcode

ActiveLibrary[Image &amp; Media](/categories/media)

tecnickcom/tc-lib-barcode
=========================

PHP library to generate linear and bidimensional barcodes

2.11.1(1w ago)3027.8M↓31.1%9120LGPL-3.0-or-laterPHPPHP &gt;=8.2CI passing

Since Apr 6Pushed 2w ago19 watchersCompare

[ Source](https://github.com/tecnickcom/tc-lib-barcode)[ Packagist](https://packagist.org/packages/tecnickcom/tc-lib-barcode)[ Docs](https://tcpdf.org)[ GitHub Sponsors](https://github.com/sponsors/tecnickcom)[ RSS](/packages/tecnickcom-tc-lib-barcode/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (19)Versions (159)Used By (20)

tc-lib-barcode
==============

[](#tc-lib-barcode)

> PHP library for generating linear and 2D barcodes.

[![Latest Stable Version](https://camo.githubusercontent.com/c3c4c11f296f868d519296cf5cce4fe30688b0a3c4165af5b93ed3200aa9e5b4/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d626172636f64652f76657273696f6e)](https://packagist.org/packages/tecnickcom/tc-lib-barcode)[![Build](https://github.com/tecnickcom/tc-lib-barcode/actions/workflows/check.yml/badge.svg)](https://github.com/tecnickcom/tc-lib-barcode/actions/workflows/check.yml)[![Coverage](https://camo.githubusercontent.com/d57f9df11369582fdf79106c29446ff898a7aae6b6bfdc5cb97933356f41d170/68747470733a2f2f636f6465636f762e696f2f67682f7465636e69636b636f6d2f74632d6c69622d626172636f64652f67726170682f62616467652e7376673f746f6b656e3d50573672393769567557)](https://codecov.io/gh/tecnickcom/tc-lib-barcode)[![License](https://camo.githubusercontent.com/fe8d535cbdfb3b493a26bcd7fe81c6fa8968904dcd08d9bace460c977e7dcd0f/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d626172636f64652f6c6963656e7365)](https://packagist.org/packages/tecnickcom/tc-lib-barcode)[![Downloads](https://camo.githubusercontent.com/23b118124e7a6b544a9c41a49a4fe185d6c49581e0140e11895c01909f25488f/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d626172636f64652f646f776e6c6f616473)](https://packagist.org/packages/tecnickcom/tc-lib-barcode)

[![Sponsor on GitHub](https://camo.githubusercontent.com/dd89cb32d6e7ff9dbb0fa7ce84923567358b220feb9198b3720beabc3153da6a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73706f6e736f722d6769746875622d4541344141412e7376673f6c6f676f3d67697468756273706f6e736f7273266c6f676f436f6c6f723d7768697465)](https://github.com/sponsors/tecnickcom)

> 💖 Part of the [tc-lib-pdf / TCPDF](https://github.com/tecnickcom/tc-lib-pdf) ecosystem (100M+ installs). [Sponsor its maintenance →](https://github.com/sponsors/tecnickcom)

---

Overview
--------

[](#overview)

`tc-lib-barcode` is a pure-PHP barcode generation library with broad support for industrial, retail, logistics, and document automation use cases.

It focuses on deterministic output and specification-driven encoding, making it suitable for labels, tickets, warehouse flows, and compliance documents. The API is structured so applications can generate barcode data once and render it as vectors or raster images depending on their output target.

**Namespace**`\Com\Tecnick\Barcode`**Author**Nicola Asuni **License**[GNU LGPL v3](https://www.gnu.org/copyleft/lesser.html) - see [LICENSE](LICENSE)**API docs****Packagist**---

Supported Formats
-----------------

[](#supported-formats)

### Linear

[](#linear)

FormatDescriptionC39CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9C39+CODE 39 with checksumC39ECODE 39 EXTENDEDC39E+CODE 39 EXTENDED + CHECKSUMC93CODE 93 - USS-93S25Standard 2 of 5S25+Standard 2 of 5 + CHECKSUMI25Interleaved 2 of 5I25+Interleaved 2 of 5 + CHECKSUMC128CODE 128C128ACODE 128 AC128BCODE 128 BC128CCODE 128 CEAN22-Digits UPC-Based ExtensionEAN55-Digits UPC-Based ExtensionEAN8EAN 8EAN13EAN 13UPCAUPC-AUPCEUPC-EMSIMSI (Variation of Plessey code)MSI+MSI + CHECKSUM (modulo 11)CODABARCODABARCODE11CODE 11PHARMAPHARMACODEPHARMA2TPHARMACODE TWO-TRACKS### 2D

[](#2d)

FormatDescriptionAZTECAZTEC Code (ISO/IEC 24778:2008)DATAMATRIXDATAMATRIX (ISO/IEC 16022)PDF417PDF417 (ISO/IEC 15438:2006)QRCODEQR-CODERAW2D RAW MODE comma-separated rowsRAW22D RAW MODE rows enclosed in square parentheses### Postal

[](#postal)

FormatDescriptionPOSTNETPOSTNETPLANETPLANETRMS4CCRMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)KIXKIX (Klant index - Customer index)IMBIMB - Intelligent Mail Barcode - Onecode - USPS-B-3200IMBPREIMB - Intelligent Mail Barcode - Onecode - USPS-B-3200 - pre-processedRendering
---------

[](#rendering)

- HTML output for web previews
- Image-based rendering for downstream processing
- Configurable dimensions, padding, and color

### Output Formats

[](#output-formats)

- PNG Image
- SVG Image
- HTML DIV
- Unicode String
- Binary String

---

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

[](#requirements)

- PHP 8.2 or later
- Extensions: `bcmath`, `date`, `gd`, `pcre`
- Composer

---

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

[](#installation)

```
composer require tecnickcom/tc-lib-barcode
```

---

Quick Start
-----------

[](#quick-start)

```
