YouHaveBO.com

Everything you never 
wanted to know about barcodes

Extrapolated Barcode Specs

Compiled by Nick Johnson.

Code 3 of 9

By far, these are the most heinous barcodes out there, mostly because of the large number of characters that can be represented with Code 39. Built into the coding scheme are all the digits and capital letters as well as the control characters *, $, /, +, and %, and space, hyphen, and period. Additional characters can be produced by combining control characters with data characters if the reader is to be operating in full ASCII mode (otherwise the characters are interpreted literally).

Each character is made up of 5 bars and 4 spaces. 3 of these 9 elements will be wide (this is where the code gets its name) and 6 narrow. The result is a character of consistant width as in EAN above. Each character is also assigned a numeric value to be used for calculating the checksum. Here are the wide and narrow vaules for the 43 characters:

CharValueB1S1B2S2 B3S3B4S4B5
11WNNWNNNNW
22NNWWNNNNW
33WNWWNNNNN
44NNNWWNNNW
55WNNWWNNNN
66NNWWWNNNN
77NNNWNNWNW
88WNNWNNWNN
99NNWWNNWNN
00NNNWWNWNN
A10WNNNNWNNW
B11NNWNNWNNW
C12WNWNNWNNN
D13NNNNWWNNW
E14WNNNWWNNN
F15NNWNWWNNN
G16NNNNNWWNW
H17WNNNNWWNN
I18NNWNNWWNN
J19NNNNWWWNN
K20WNNNNNNWW
L21NNWNNNNWW
M22WNWNNNNWN
N23NNNNWNNWW
O24WNNNWNNWN
P25NNWNWNNWN
Q26NNNNNNWWW
R27WNNNNNWWN
S28NNWNNNWWN
T29NNNNWNWWN
U30WWNNNNNNW
V31NWWNNNNNW
W32WWWNNNNNN
X33NWNNWNNNW
Y34WWNNWNNNN
Z35NWWNWNNNN
-36NWNNNNWNW
.37WWNNNNWNN
38NWWNNNWNN
*(none)NWNNWNWNN
$39NWNWNWNNN
/40NWNWNNNWN
+41NWNNNWNWN
%42NNNWNWNWN

W=wide, N=narrow

You can grab a copy of the translation table here.

To calculate the check digit, add the values of all the digits and take the modulus 43 of that sum. So if the sum was 178, the digit would be 6.

The checksum is rarely used because the code inherently checks itself; anything that doesn't match the 3 of 9 format is discarded as a bad scan.

Code 3 of 9 Barcode Image

All Code39 barcodes begin and end with the * control character and should not exceed 32 characters, including the start and stop characters as well as the check character. The wide to narrow ratio should be between 2.25:1 and 3:1. Also, the Characters per inch should be between 2.3 and 9.4, with 4.7 being fairly typical. This means having 75.2 X-dimensions per inch. The X-dimension is the fundamental element that the narrow bars, spaces, and often the intercharacter gap are based on.
(you do not need to enter the start and stop * character)
calculate check digit use normal (not full ascii) mode

Codabar
Codabar
Code 2 of 5
Code 2 of 5
Code 3 of 9
Code 3 of 9
Interleaved 2 of 5
Interleaved 2 of 5
Postnet
Postnet
UPC
UPC
Code 128
Code 128
Code 16k
Code 16k




Vi Powered Lynx Now! Powered by FreeBSD
Mon Feb 8 22:51:33 PST 2010   barcode/code39.src
Updated: Thu Aug 18 2005 9:31.35   Viewed: never

Copyright © 1998-1999 by Nick Johnson. All rights reserved.