EAN Check.comEAN Check.com

Code 39 Barcode Generator

Make a Code 39 barcode from capitals, digits and a few symbols for asset tags, part labels and systems that still expect it, and download it as SVG, PNG, EPS or PDF. Lower case is changed to capitals for you.

By The eancheck teamPublished

What Code 39 is

Code 39 was one of the first barcodes that could carry letters as well as digits. David Allais and Ray Stevens designed it at Intermec in 1974, and it is standardised as ISO/IEC 16388. Its name comes from its structure: each character is nine elements, five bars and four spaces, and three of them are wide. Some older documents call it Code 3 of 9 for that reason.

It is simple to print and simple to read, and a plain font can draw it, which is why it spread through manufacturing, defence and healthcare in the 1980s and why so many systems still expect it. Asset tags, part labels and older warehouse systems are the places you will meet it today. Product barcodes for shops are a different family: see UPC-A and EAN-13.

The 43 characters

Code 39 encodes the digits 0-9, the capitals A-Z, the space and six symbols: - . $ / + %. That makes 43. The asterisk * is the start and stop character and cannot appear inside the data.

A Full ASCII variant writes the other characters, such as lower case, as pairs of Code 39 characters: +A for a, for example. Scanners only decode it when they are set to that mode, so treat it as a special case and agree on it with whoever scans your labels.

Font or image?

Code 39 is a barcode a font can draw on its own, because it has no compulsory check character. That is why so many Excel sheets and Word letters use one. A font only works if you type the asterisks yourself, around the value, for example *ASSET0042*.

Three things go wrong with fonts: the asterisks are missing, the text has lower case or characters outside the 43, or the font is too small for the printer to draw the narrow bars cleanly. The generator avoids all three, adds the quiet zones and gives you a PNG or SVG to insert. For a whole column of asset numbers, switch to A list or CSV and download a ZIP or a label sheet. Make a numbered sequence fills the list for you, from ASSET0001 to ASSET0500 or any other run up to 5 000.

Width and size

Code 39 is wide. Each character takes about 16 modules including the narrow gap after it, there is no way to pack digits in pairs, and the start and stop characters add two more. These widths come from this generator at X 0.33 mm, including 10-module quiet zones:

TextCode 39Code 128, for comparison
1234567859.1 mm32.7 mm
ABC-123459.1 mm43.6 mm
SN-2026-0041785.5 mm61.7 mm
PALLET 0042 BAY 7106.6 mm79.9 mm

To fit a small label, lower X before anything else; 0.25 mm is about 10 mils and exactly 2 dots on a 203 dpi printer. US asset tag specifications often give X in mils, and More settings switches the tool to mils or inches. On a label printer, choose Label printer under Printing on and your printer's dpi: every narrow and wide bar then lands on whole printer dots, and 0.25 mm is exactly 2 dots at 203 dpi. Print the PNG at 100%.

ISO/IEC 16388 recommends bars at least 15% as tall as the barcode is long without its quiet zones, and never under 5 mm. An 8-character Code 39 at X 0.33 mm is 52.5 mm long, so its bars should be about 8 mm tall. Taller bars let a scanner held at an angle still cross every bar.

The optional check character

Each Code 39 character has its own fixed pattern of three wide elements, so a scanner can tell a damaged character from a valid one. That is why the standard makes the mod 43 check character optional. Some systems require it anyway. The generator draws Code 39 without it; if your receiving system expects one, type it at the end of your data, and ask the system's supplier which settings it uses before printing a large batch.

Type your text below to see whether every character fits and which check character to add.

Code 39 character and check digit checker

Every character fits. Mod 43 check character: R, so the full data is CODE 39R.

The check character is optional in Code 39. Add it only when the scanner or the spec you work to expects one (ISO/IEC 16388, Annex A).

Where Code 39 is still required

US defence shipping labels follow MIL-STD-129. Published summaries of Revision R say it still allows Code 39 next to the 2D barcode PDF417, and prefers PDF417. The older LOGMARS standard, MIL-STD-1189, used Code 39 alone and is reported cancelled. Parts that need a unique item identifier carry a Data Matrix under MIL-STD-130. We could not check these against the Department of Defense's own standards database, so follow the revision your contract names.

Automotive suppliers label parts to AIAG standards that allow it, and the health industry's HIBC labelling standard still allows Code 39 next to Code 128 and 2D codes. Many companies also have years of asset tags in Code 39 and keep printing new ones to match. If the tags show a department name rather than the number, set Text under the bars to Own text in More settings; the bars still hold the number.

If none of those apply, you are free to choose, and Code 128 is the better choice: shorter, with a mandatory check character, and able to hold lower case.

Frequently asked questions

What characters can Code 39 hold?

43 characters: the digits 0 to 9, the capitals A to Z, the space, and the six symbols - . $ / + %. The asterisk is reserved as the start and stop character. Lower case is not part of the standard set; the generator turns it into capitals and tells you it did.

Why are there asterisks around my Code 39 text?

Because every Code 39 barcode starts and ends with an asterisk, and many printed labels show them in the text line so a reader can see the barcode is complete. Scanners read the asterisks but do not pass them on, so your data arrives without them. To print a name or no text at all instead, change Text under the bars in More settings.

Does Code 39 have a check digit?

Not by default. Each character is self-checking, which already catches most misreads. An optional mod 43 check character exists for systems that demand it, but the scanner has to be set up to expect it, so only add it when the receiving system asks. The checker on this page works it out for you.

How is the Code 39 check character worked out?

By adding up character values and dividing by 43. The digits 0 to 9 count as 0 to 9, A to Z as 10 to 35, then - is 36, . is 37, space 38, $ 39, / 40, + 41 and % 42. Take the remainder of the sum divided by 43; the character with that value is the check character. For CODE39 the sum is 75, the remainder 32, so the check character is W.

Can Code 39 encode lower case letters?

Only in a variant called Full ASCII Code 39, which writes each lower case letter as two characters, such as +A for a. Scanners have to be set to that mode, and the barcode gets much longer. If you need lower case, use Code 128 instead: it holds the full ASCII set in a shorter barcode.

How do I make a Code 39 barcode in Excel with a font?

Put asterisks around the value. Install a Code 39 font such as Libre Barcode 39 from Google Fonts, write a formula such as ="*"&A2&"*" and set that cell in the barcode font. The asterisks are the start and stop characters; without them nothing scans. Use capitals only. If a scanner still fails, make the barcodes here in bulk mode and insert the images, which carry the quiet zones.

Why is my Code 39 barcode so wide?

Each character takes about 16 modules including the gap after it, against 11 for Code 128, and there are no digit pairs. Eight digits make a Code 39 about 59 mm wide at X 0.33 mm, while Code 128 needs about 33 mm. Lower X, or use Code 128 if the receiving system allows it.

What wide-to-narrow ratio should Code 39 use?

Anything from 2:1 to 3:1 meets ISO/IEC 16388. This generator uses 3:1, because a wide bar three times the narrow one is the easiest for a scanner to tell apart. A 2:1 ratio makes the barcode about 20% shorter, but on a thermal printer that spreads the bars, wide and narrow can end up too alike to read reliably.

Should I use Code 39 or Code 128?

Code 128 for anything new. Choose Code 39 only when an existing system, a customer specification or an industry standard requires it, such as US defence shipping labels, automotive part labels or a company's older asset tags. For the same text, Code 128 is about half as wide on long numbers and about three quarters as wide on mixed text.

Does the US military still use Code 39?

Yes, but less than before. Published summaries of MIL-STD-129 Revision R, the standard for defence shipping labels, say it allows Code 39 and PDF417 and prefers PDF417. The older LOGMARS standard, MIL-STD-1189, is reported cancelled. Parts that need a unique item identifier are marked with a Data Matrix under MIL-STD-130. Follow the revision your contract names.

By The eancheck teamPublished

Questions or corrections? Email the eancheck team.