DotCode


DotCode is a two-dimensional (2D) matrix barcode invented in 2008 by Hand Held Products as a replacement for the outdated Code 128. At this time, it is issued by Association for Automatic Identification and Mobility (AIM) as “ISS DotCode Symbology Specification 4.0”. DotCode consists of sparse black round dots and white spaces on white background. In case of a black background the dots can be white. DotCode was developed to be used with high-speed industrial printers where printing accuracy can be low. Because DotCode by the standard does not require complicated elements like continuous lines or special shapes it can be applied with laser engraving or industrial drills.
DotCode can be represented as rectangular array with minimal size of each side 5X dots. Maximal size of DotCode is not limited by the standard but practical limit is recommended as 100x99 which can encode around 730 digits, 366 alphanumeric characters or 304 bytes.
As an extension of Code 128 barcode, DotCode allows more compact encoding of 8-bit data array and Unicode support with Extended Channel Interpretation feature. Additionally, DotCode provides much more data density and Reed–Solomon error correction which allows to restore partially damaged dotcodes. However, the main DotCode implementation, the same as Code 128, is effective encoding of GS1 data which is used in worldwide shipping and packaging industry.

History and standards

DotCode barcode was invented in 2008 by Dr. Andrew Longacre from Hand Held Products company and standardized in 2009 by AIM as “Bar code symbology specification - DotCode”. In 2019 DotCode was reviewed as “ISS DotCode Symbology Specification 4.0”.
Set of patents is registered, which are related with DotCode encoding and decoding:
  • United States Patent US20090200386A1 by Hand Held Products Inc "Machine readable 2D symbology printable on demand"
  • United States Patent US20090200386A1 by Datalogic IP Tech SRL "System and method for extracting bitstream data in two-dimensional optical codes"
  • Chinese Patent CN113297872A by Fuzhou Symbol Information Technology Co ltd "Dotcode identification method and equipment"

    Application

DotCode barcode can be used in the same way as Code 128 or any matrix barcode. At this time, it is used mostly to encode GS1 data in tobacco, alcoholic and non-alcoholic beverage, pharmaceutical and grocery industries. The main implementation at this time is in tobacco industry.
Main advantages of DotCode are:
DotCode represents data in rectangular structure which consists from black round dots and white spaces on white background or white round dots on black background. DotCode does not have finder pattern, like other 2D barcodes and it must be detected with slow blob detection algorithms like Gabor filter or Circle Hough Transform. All data, metadata and error correction codewords are encoded in the same dots array which does not have any visual difference.
Here are some samples of DotCode:
DotCode symbol is constructed from the following elements:
  • Two mask bits which are represented on diagram as two green points;
  • Data bits which must be read from up to down and from left to right ;
  • Corner points, marked as red on diagram, which can be used as data bits or padding bits ;
  • Quiet zone at least 3X size of the dots.
The DotCode bits array is represented as:
'
The data codewords in 0 – 112 range are encoded in 5-of-9 binary dot patterns which are encoded from 9 dots where 5 black dots and 4 white spaces. The rest of barcode matrix is padded with black padding bits. The padding bits can be from 0 to 8. The logically DotCode bits array is represented as:
'

DotCode size has the following requirements:
  • Sum of DotCode width and height must be odd: ;
  • Minimal size of each side must be 5, maximal is not limited;
  • It is recommended to use width and height to have at least 6 padding black bits where data bits capacity rest from division on 9 more or equal 6:

    Data masking

To minimize DotCode problematic symbols, the data codewords are masked to create others visual sequences. The mask pattern is applied only to data sequence and does not affect error correction codewords. DotCode standard has 4 mask pattern which are codded into 2 bits and placed as the first 2 bits of symbol bits array.
MaskBitsMasking operation
Example:099 099 099 099 099 099 099 099 106
000Adds successive multiples of 0 to each value, i.e., no change
099 099 099 099 099 099 099 099 106
101Adds successive multiples of 3 to each value, modulo 113
099 102 105 108 111 001 004 007 017
210Adds successive multiples of 7 to each value, modulo 113
099 106 000 007 014 021 028 035 049
311Adds successive multiples of 17 to each value, modulo 113
099 003 020 037 054 071 088 105 016

Error correction

DotCode uses Reed–Solomon error correction with prime power of 3 and finite field or. The data codewords is represented with values from 0 to 112 and mask value is counted as leading data codeword from 0 to 3. In this way the data protected array length is. But amount of error correction codewords is calculated only from ND:
,
where ND is data codewords and NC - error correction codewords.
The resulting codewords NW with error correction codewords is:
,
where NW is all encoding codewords: 1 mask codeword + data codewords + error correction codewords.
Because Reed–Solomon error correction cannot correct amount of codewords which are more than polynomial, if NW happens to exceed 112, the data is split into error correction blocks:
,
where B is block counts.
The data can be split into block in the following way, for each block ‘’’n’’’, for n equals 1 to B:
The error correction data is written after single data block in scrambled mode:
''...''

Encoding

DotCode encoding size is not limited by standard, but practical encoding size in 100x99 version which includes 4950 dots can encode 366 raw data codewords, 730 digits, 365 alphanumeric characters, or 304 bytes. The data message in DotCode is represented with data codewords from 0 to 112 which are encoded with 5-of-9 binary dot patterns.
DotCode supports the following features:
There three main rules at message encoding start:
  • The default starting encoding is Code Set C;
  • In case of two digits in Code Set C are encoded in the position of the first codeword, the message is decoded as GS1 message;
  • If FNC1 or other non-digit codeword is encoded in the position of the first codeword, the message is decoded as NON GS1 message.

    Binary byte encoding

DotCode can encode full 8-bit charset in two ways:
  • With Upper Shift, which requires 2 codewords on one symbol;
  • With Binary Latch, which requires 1 Binary Latch symbol and 6 codewords on every 5 bytes.
Upper Shift modes can encode extended ASCII characters in two codewords with returning to previous mode:
Upper Shift TypeCodewordsASCII
Upper Shift A64 to 95128 to 159
Upper Shift B0 to 95160 to 255

Binary Latch mode can encode 8-bit charset and ECI sequences from 1 to 5 symbols. It uses the following rules:
  • The data is split into block of 5 symbols or 6 codewords;
  • 0 – 258 values are radix converted from five base 259 into six base 103 values;
  • 0 – 255 values are byte values;
  • 256, 257 or 258 values marks to encode ECI sequence in next 1, 2 or 3 bytes respectively;
  • Any DotCode codewords in the encoded sequence above 102 interrupt or change mode.
CodewordOperation
103Interrupt for 2x Shift C
104Interrupt for 3x Shift C
105Interrupt for 4x Shift C
106Interrupt for 5x Shift C
107Interrupt for 6x Shift C
108Interrupt for 7x Shift C
109Terminate with Latch to A
110Terminate with Latch to B
111Terminate with Latch to C
112Terminate with Symbol Separation, Latch to C

As we see in the following table, Binary Latch encodes data more effectively, starting from 3 bytes.
Bytes countCodewords requiredCodewords with latch and return requiredUpper Shift codewords required
1242
2354
3466
4578
56810

ECI encoding

DotCode can encode ECI indicator int two ways:
  • In Binary Latch mode ;
  • With FNC2 character.
FNC2 in any position except at the end of data signals the insertion of an ECI sequence – "\nnnnnn", which represents values between 000000 and 811799. The values can be encoded in 1 or 3 codewords:
  • In case of next codeword < 40 directly encodes ECI value 000000 to 000039;
  • Otherwise, the next three codewords valued A, B, & C encode an ECI value of.

    GS1 encoding

Any two digits in the position of the first codeword identify a symbol as GS1 encoded. In case of symbol with two digits in the position of the first codeword must be decoded as ordinary data, the FNC1 must be inserted at the place of the first codeword. FNC1 in the other than the first position works as GS1 Application Identifier splitter and decoded as GS character.
Codeword 100 in Code Set C encodes application GS1 AI the next 3 codewords is an expiration date and inserts GS1 AI before decoding other codewords:
'' -> 17241230105664''

Macros mode

Some data codewords 97 – 100 in the lead data position in Code Set B can encode “Macros”. In any other position it encodes ASCII symbol:
>RS05GS … RSEoT
''>RS05GS … RSEoT''

Structured append

DotCode can create composite symbol, where data from multiple DotCode symbols can be logically united. This can be made with FNC2 symbol in last data position. When FNC2 is in the final data position, then the preceding two message characters, digits and uppercase letters in order 1 to 9 then A to Z shall as "m" and "n" designate where this message belongs in a "m out of n" sequence. As an example, a symbol whose message ends "4 B FNC2" shall be the 4th symbol out of 11 that comprise the entire message.

Special modes encoding

FNC3 in the first codeword position indicates that the message is the instructions for initialization or reprogramming of the bar code reader.
FNC3 in any other position than first indicates that encoded message must be logically separated into two distinct messages ;

Data padding

DotCode symbol codewords capacity is:
DotCode symbol data codewords capacity is:
In this way we need to pad data codewords in case with have free space. There are two rules:
  • Binary mode must be terminated with Latch to Code Set A ;
  • In other modes codeword 106 must be used.