bardecode.com

  • Increase font size
  • Default font size
  • Decrease font size
Home FAQ Why do I get an extra character when I read a Code 39 barcode?

Why do I get an extra character when I read a Code 39 barcode?

Code 39 barcodes often include a checksum character, which is not usually printed under the barcode. There is no way for the toolkit to determine whether the last character is a checksum or just part of the barcode string - and so all the characters are included in the string returned to the calling application.

The checksum for Code 39 barcodes is usually a mod-43 checksum worked out as follows:

Each character in the symbol set has a value. 0 = 0, 1 = 1,...., 9 = 9, A = 10,......, Z = 35, - = 36, . = 37, space = 38, $ = 39, / = 40, + = 41, % = 42.

Sum the values of the characters and take the remainder on division by 43. This is the value of the checksum.