Code 39 Generator
Alphanumeric industrial barcode with optional checksum; common in automotive and defense labeling.
How Code 39 is structured
Code 39 encodes 43 characters — digits, uppercase A to Z, space and the punctuation - . $ / + %. Each character is nine elements wide, exactly three of them wide, which is where the name comes from, and a narrow gap separates every character from the next. The symbol starts and stops with the asterisk character, which the reader consumes and which never appears in the human-readable line.
Code 39 check digit
Code 39 is self-checking, so no check digit is required. Where an application mandates one, a modulo-43 check character is appended: sum each character's value — digits 0 to 9, A to Z as 10 to 35, space 38, - 36, . 37, $ 39, / 40, + 41, % 42 — divide by 43 and append the character at that position. The reader must be told to expect it, otherwise it returns the check character as data.
Code 39 compared with Code 128
Code 128 fits the same text in roughly half the width and covers lowercase, which is why new applications default to it. Code 93 is the denser sibling of Code 39: same character set, no inter-character gap, and two mandatory check characters instead of an optional one. Compare the Code 128 generator page for the same breakdown of structure, check digit and use cases.
Common Code 39 problems
Lowercase letters were entered
Code 39 has no lowercase. Uppercase the payload before generating, and beware a workflow that silently converts case — the symbol then scans back as different text from what the operator typed.
Full ASCII data does not decode as expected
Lowercase and characters outside the 43-character set are encoded as two-symbol escape pairs. That only works when the reader is configured for full ASCII Code 39; otherwise it returns the escape characters literally.
The mod-43 check character comes back as data
A check character is only stripped when the reader knows to look for it. Enable the Code 39 check digit on the scanner, or leave the check character out entirely rather than printing a symbol the reader cannot validate.
Where Code 39 is used
- Automotive and AIAG part and container labels
- US defense logistics (LOGMARS) and government asset marking
- Name badges, equipment tags and inventory shelf labels
Not sure this is the right symbology? The barcode format guide groups every supported 1D and 2D format by industry with its character set and limits.