Barcode — Densest
While working on a project involving barcode “Interleaved 2 of 5” I found that several references were made about its compactness.
This I took to mean a challenge! Are there denser barcodes? How about designing one that is as compact as possible.
It was also apparent that Interleaved 2 of 5 had some curious limitations. It only accepts an even number of characters. This is because it encodes pairs of characters at a time. Another related problem is that it's not possible to have a simple mapping between characters and font slots. One would need to have a font of 100 characters so that every pair of decimal digits is accommodated.
I wanted to address this while designing a denser code. I created some barcode generators so that a visual comparison can be made. Included are UPC–A, EAN–13, Interleaved 2 of 5, and Code 39 generators.
A detailed technical explanation of the encoding of the new experimental compact barcode is found below.
Here are the barcode generators showing a comparison of existing barcodes compared with my new compact one.
Advantages over Interleaved 2 of 5:
- • 32% shorter than Interleaved 2 of 5
- • variable length message (not restricted to an even number)
- • reasonable font size: 20 characters plus 5 ETX (end of text) sentinels
This is the most compact linear barcode with a small monospaced font footprint.
- Data alphabet size: 10 symbols
- Bi–directional scanning (reverse scan distinct)
- No built–in checksum.
- 3 element widths — 1,2,3 modules.
- A character consists of 2 to 4 elements alternating black & white.
- Whether a character starts with black or white element depends on context.
- Width of each character is 5 modules.
- No STX (start of text) sentinel.
Reverse scan is detected by the combination of ETX (if any) and last character patterns that do not total 5 modules or form an illegal sequence 1,1,1,2 or 1,1,3. See table below to choose the appropriate ETX depending on the last character in the data.
Character encoding chart
|Character||Elements||ETX white||ETX black|
The ETX (end of text) character is appended to the right of the data.
ETX white is used when last element of last character is white.
ETX black is used when last element of last character is black.
The following element width sequences are not used and are illegal: 1,1,1,2 and 1,1,3.
The sequence 1,1,1,1 is also illegal since its total width does not add to 5.
* ETX is optional because a reverse scan would encounter an illegal sequence without it.
Average width of ETX sentinel is 1.75 modules. This can be reduced to 1.55 modules if ETX is omitted for the indicated cases.
Comparison of barcode widths
|Dense150708||5N + 1.55|
|Code 128||5.5N + 33|
|Interleaved 2 of 5||7N + 8|
|UPC–A / EAN–13||7 × 12 + 11 = 95|
|Code 11||7.8N + 15|
|Code 93||9N + 19|
|Codebar||10N + 21|
|MSI Plessey||12N + 7|
|Code 39||13N + 25|
|Industrial 2 of 5||14N + 15|
Revised 25 Jul 2015