# Matrix 2 of 5

> Source: https://docs.barcoder.ai/docs/standards/matrix-2-of-5
> research date 2026-06-04 · extracted at 2026-10-03
> Publisher: Barcoder — encyclopedia of QR, barcode and payment-code standards

Specifications:
- [Matrix 2 of 5 — Wikipedia](https://en.wikipedia.org/wiki/Matrix_2_of_5)
- [Matrix 2 of 5 — HandWiki](https://handwiki.org/wiki/Matrix_2_of_5)

## Overview

**Matrix 2 of 5** is a **variable-length, discrete, two-width, numeric-only** 1D barcode in the "2 of 5" family, encoding only the digits 0–9 <sup>[1][1], [2][2]</sup>. It shares the family's basic rule but differs from [Standard 2 of 5](https://docs.barcoder.ai/docs/standards/standard-2-of-5) in one decisive way: **Matrix 2 of 5 encodes data in both the bars and the spaces**, not in the bars alone <sup>[1][1]</sup>. Each digit is represented by **five elements, two wide and three narrow**, and that pattern can fall in either bars or spaces — making Matrix 2 of 5 **denser than Industrial 2 of 5** while remaining a discrete code <sup>[1][1]</sup>.

It occupies a middle ground in the family: denser than the bars-only [Standard 2 of 5](https://docs.barcoder.ai/docs/standards/standard-2-of-5) and [IATA 2 of 5](https://docs.barcoder.ai/docs/standards/iata-2-of-5), but still **less dense than the fully interleaved [ITF](https://docs.barcoder.ai/docs/standards/itf)**, because as a discrete symbology it needs separating gaps between character patterns <sup>[1][1]</sup>.

## History

**Matrix 2 of 5 was developed in the 1970s by Nieaf Co. in the Netherlands** <sup>[1][1]</sup>. It was created during the same early-1970s flowering of "2 of 5" symbologies that produced [Standard 2 of 5](https://docs.barcoder.ai/docs/standards/standard-2-of-5) (Identicon / Computer Identics, 1971), [ITF](https://docs.barcoder.ai/docs/standards/itf) (David Allais, 1972) and [IATA 2 of 5](https://docs.barcoder.ai/docs/standards/iata-2-of-5) (Computer Identics, 1974).

The family's shared "2 of 5" rule — five elements per digit, two wide — is the common thread. Matrix 2 of 5's contribution was to push that rule into the spaces as well as the bars, recovering some of the density lost by the bars-only ancestors without going as far as full interleaving <sup>[1][1]</sup>.

## Technical specification

Matrix 2 of 5 is a **discrete, numeric-only, variable-length** 1D symbology <sup>[1][1], [2][2]</sup>:

| Parameter | Value |
|---|---|
| Symbology family | 1D linear, "2 of 5" family |
| Character set | **Digits 0–9 only** |
| Length | Variable |
| Encoding | **Data in bars AND spaces** — each digit = 5 elements, **2 wide + 3 narrow**, in bars or spaces; digits effectively paired (5 bars + 5 spaces → 2 digits) <sup>[1][1]</sup> |
| Discrete | Yes — extra inter-character space separates patterns <sup>[1][1]</sup> |
| Self-checking | No |
| Check digit | Optional, **Mod 10 / weight 3** (other schemes also usable) <sup>[1][1]</sup> |
| Start pattern | `WNNNN` (wide–narrow–narrow–narrow–narrow) <sup>[1][1]</sup> |
| Stop pattern | `WNNNN` (same as start) <sup>[1][1]</sup> |
| Narrow:wide ratio | ~1:2 to 2:5 <sup>[1][1]</sup> |
| Quiet zone | 10 × narrow-element width each side <sup>[1][1]</sup> |
| Density | ~11 % longer than [ITF](https://docs.barcoder.ai/docs/standards/itf); ~82 % longer than [Code 128](https://docs.barcoder.ai/docs/standards/code-128) <sup>[1][1]</sup> |

**Data in bars and spaces** <sup>[1][1]</sup>: this is the distinguishing feature. Where [Standard 2 of 5](https://docs.barcoder.ai/docs/standards/standard-2-of-5) confines data to the bars and leaves spaces as uniform separators, **Matrix 2 of 5 puts the wide/narrow 2-of-5 pattern into both bars and spaces** — three black bars plus two white spaces per digit pattern, with the same wide/narrow ratio applied to spaces as to bars. This roughly halves the wasted width of the bars-only design, which is why Matrix 2 of 5 is denser than Industrial 2 of 5 <sup>[1][1]</sup>.

**Why it is still less dense than [ITF](https://docs.barcoder.ai/docs/standards/itf)** <sup>[1][1]</sup>: Matrix 2 of 5 is a **discrete** symbology — each character pattern is self-contained and separated from the next by additional space. Interleaved 2 of 5 is **continuous and interleaved**, with no wasted inter-character gaps, so ITF stays ~11 % shorter than Matrix 2 of 5 for the same data.

**Check digit** <sup>[1][1]</sup>: an optional Mod-10 (weight-3) check digit is typical, though implementations may substitute other checksum schemes.

## Use cases

Matrix 2 of 5's historical deployments overlap heavily with the rest of the family <sup>[1][1]</sup>:

- **Warehouse sorting** — numeric item/bin identifiers on conveyors and shelving.
- **Photo finishing** — order and batch numbering through the develop-and-print workflow.
- **Airline ticket marking** — sequential and identifier numbering on tickets.

Its denser-than-Industrial-2-of-5 layout made it attractive where label width was constrained but full interleaving (ITF) was not yet adopted.

## Implementations

Matrix 2 of 5 survives as a legacy format in barcode libraries and scanner SDKs <sup>[1][1], [3][3], [5][5]</sup>:

- **C** — [zint/zint][5] — ~771★, active 2026. Lists "Code 2 of 5 Standard (Matrix)" among supported symbologies.
- **JavaScript** — `bwip-js` (BWIPP) exposes `matrix2of5`.
- **Commercial** — Accusoft Barcode Xpress, DevExpress Office File API, and Seagull/BarTender all include Matrix 2 of 5; "most barcode readers support this symbology" <sup>[1][1]</sup>.
- **Reference docs** — DevExpress and Raynet RayVentory document Matrix 2 of 5 in their barcode-generation APIs <sup>[4][4]</sup>.

## Comparison

**vs. [Standard 2 of 5](https://docs.barcoder.ai/docs/standards/standard-2-of-5) (Industrial 2 of 5)** — the defining contrast within the family. **Industrial 2 of 5 encodes data in the bars only**; **Matrix 2 of 5 encodes data in both bars and spaces**, making it **denser than Industrial 2 of 5** while still discrete <sup>[1][1]</sup>.

**vs. Interleaved 2 of 5 ([ITF](https://docs.barcoder.ai/docs/standards/itf))** — both use bars and spaces for data, but **ITF interleaves two digits continuously with no inter-character gaps**, whereas **Matrix 2 of 5 is discrete** and needs separating space — leaving Matrix ~11 % longer than ITF for the same payload <sup>[1][1]</sup>. ITF is the density winner.

**vs. [IATA 2 of 5](https://docs.barcoder.ai/docs/standards/iata-2-of-5)** — IATA 2 of 5, like Standard 2 of 5, is **bars-only** and differs from Standard only in start/stop; Matrix 2 of 5 is the denser bars-and-spaces member of the family <sup>[1][1]</sup>.

**Family density ranking** (most to least dense, numeric data): [ITF](https://docs.barcoder.ai/docs/standards/itf) > **Matrix 2 of 5** > [Standard 2 of 5](https://docs.barcoder.ai/docs/standards/standard-2-of-5) / [IATA 2 of 5](https://docs.barcoder.ai/docs/standards/iata-2-of-5) <sup>[1][1]</sup>.

## Status

**Legacy / niche.** Matrix 2 of 5 is no longer chosen for new deployments but remains supported by barcode-generation libraries (zint, bwip-js) and commercial SDKs (Accusoft, DevExpress, Seagull/BarTender), and most scanners still decode it <sup>[1][1], [3][3], [4][4], [5][5]</sup>. For new numeric applications, [ITF](https://docs.barcoder.ai/docs/standards/itf) (higher density) or [Code 128](https://docs.barcoder.ai/docs/standards/code-128) (alphanumeric) are the standard replacements.

## Sources

[1]: https://en.wikipedia.org/wiki/Matrix_2_of_5
[2]: https://handwiki.org/wiki/Matrix_2_of_5
[3]: https://www.accusoft.com/barcodes/matrix-2-of-5-barcodes/
[4]: https://docs.devexpress.com/OfficeFileAPI/15141/barcode-generation-api/bar-code-types/matrix-2-of-5
[5]: https://github.com/zint/zint
[standard-2-of-5]: https://docs.barcoder.ai/source/standards/standard-2-of-5
[iata-2-of-5]: https://docs.barcoder.ai/source/standards/iata-2-of-5
[itf]: https://docs.barcoder.ai/source/standards/itf
[code-128]: https://docs.barcoder.ai/source/standards/code-128

1. [Matrix 2 of 5 — Wikipedia][1]
2. [Matrix 2 of 5 — HandWiki][2]
3. [Matrix 2 of 5 Barcodes — Accusoft Barcode Xpress][3]
4. [Matrix 2 of 5 — DevExpress Office File API][4]
5. [zint/zint — GitHub][5]

## Deployments

_No country reports mention this standard by name._

## Regions / aggregations not mapped to a single country

- Universal
