1D Free plan

Code 39 Barcode Generator API

Self-checking barcode used in automotive and defense

Sample Code 39 barcode

*PART-4471A* PART-4471A

Generated live by the BarGen API from PART-4471A

Code 39 is one of the earliest alphanumeric linear symbologies, standardized as ISO/IEC 16388. It encodes uppercase letters A-Z, digits 0-9, and seven symbols (space, hyphen, period, dollar sign, slash, plus, percent), with each character represented by nine bars and spaces, three of which are wide. Its self-checking structure and simple decoding logic made it easy for early scanner hardware to implement, and it remains readable by essentially every barcode scanner on the market.

Requesting a Code 39 symbol from BarGen only requires the format parameter set to code39 and an uppercase alphanumeric string; lowercase input is automatically converted since Code 39 has no lowercase letters. Output is available as SVG for label printing workflows or PNG for quick embedding in documents and web pages, with an optional checksum character for higher-assurance applications.

Code 39, also known as Alpha39 or Code 3 of 9, is one of the oldest barcode symbologies still in widespread use. Developed in 1974, it was the first barcode to encode alphabetic characters along with numbers.

The symbology is self-checking, meaning a single printing defect will not cause a wrong character to be read. Each character is represented by 9 elements (5 bars and 4 spaces), where 3 of the 9 elements are wide, giving the code its name.

Code 39 can encode uppercase letters A-Z, digits 0-9, and special characters including space, minus, plus, period, dollar sign, slash, and percent. While it has lower data density than Code 128, its simplicity and reliability make it popular for many applications.

It is the standard barcode used by the United States Department of Defense (LOGMARS) and is widely used in automotive, healthcare, and manufacturing industries.

Common use cases

Automotive parts identification

Automotive manufacturers and parts suppliers use Code 39 on component labels because it was adopted early in the industry and remains part of several long-standing labeling specifications.

Defense and government logistics (LOGMARS)

The U.S. Department of Defense LOGMARS standard specifies Code 39 for military supply chain labeling, so contractors printing compliant labels still rely on it.

Industrial and asset nameplates

Code 39 appears on equipment nameplates and industrial asset labels where the limited character set of uppercase letters and digits is sufficient for identifiers.

Generate Code 39 via the REST API

curl "https://api.bargen.pro/v1/barcode/code39?data=PART-4471A&format=svg" \
  -H "X-API-Key: YOUR_API_KEY"

Returns the barcode as SVG. See the API documentation for all options.

Frequently asked questions

Why is Code 39 limited to uppercase letters?

The symbology was designed in 1974 with a character set of 43 symbols to keep decoding simple for the scanner hardware available at the time, and lowercase letters were never added. Lowercase input is typically uppercased automatically before encoding.

Is a checksum required for Code 39?

No, the checksum is optional in the base specification, though the LOGMARS defense standard and some quality-sensitive applications require a modulo 43 check character for an extra layer of scan verification.

How much space does Code 39 need compared to Code 128?

Code 39 needs roughly 40 to 50 percent more horizontal space than Code 128 for the same data because each character uses nine wide-or-narrow elements. It remains a reasonable choice only when label real estate is not the constraint.

Specifications

Characters
A-Z, 0-9, -.$/+% and space
Density
Low to medium
Check Digit
Optional (Modulo 43)

Availability

Available from the Free plan.

See pricing

Related formats

Start generating Code 39 barcodes

Free tier with 1,000 API calls per month. No credit card required.