Barcode module size calculator

Measure the symbol, enter how much data it encodes, and get the module size (X-dimension). Works for linear codes, QR Code and Data Matrix.

Quiet zones are not included.

Higher levels need a larger symbol.

Leave on Auto unless you know the size. You can also count the modules along one side.

Take it from the print specification. 3:1 is common.

Module size (X-dimension)

–

Total modules

–

Not sure which Code 128 variant it is?

Only one row can be right. Pick the one that gives a typical print size (for example 0.25, 0.33 or 0.5 mm, or 10, 13 or 20 mil) or a px value that stays consistent across several images. Code C and GS1-128 only apply if the content is all digits.

How the total was counted

Notes and assumptions

Module size = measured length ÷ number of modules. For linear codes, measure from the first bar edge to the last bar edge. For 2D codes, measure the full side of the symbol. Never include the quiet zone.

Code 128 and GS1-128: the count excludes start, check, stop and FNC1 symbols, which are added automatically. For GS1-128, count the digits only (the brackets around AIs are not encoded). Anything else the encoder adds, such as code switches or FNC1 separators after variable-length AIs, goes into Extra symbols.

Reading the Code 128 start character: the first six elements, in modules, are bar 2, space 1, bar 1, then space 4, bar 1, space 2 for Start A; 2, 1, 1, 2, 1, 4 for Start B; and 2, 1, 1, 2, 3, 2 for Start C. Most decoders drop this symbol from their output, so it does not appear in the decoded text.

QR Code and Data Matrix: the size is the smallest standard symbol that holds the content in a single encoding mode. Encoders that mix modes inside one symbol, or use a minimum size setting, can produce a different size. In that case choose the size manually. For Data Matrix, long runs of capitals or lowercase can be compacted by some encoders so a smaller symbol than calculated may be possible.

Accuracy: the arithmetic is exact. The result depends on the right symbol count, the right wide:narrow ratio and a precise measurement. A measurement error of one module matters most on short codes.