Choose language

Code 39 Barcode Generator

Generate Code 39 barcodes from letters, digits, and a few symbols. Adjust scale and bar height, toggle human-readable text, and download as PNG or SVG.

Mehmet Demiray Published Updated
Share
Barcode GeneratorThe general barcode tool covering retail, logistics and general symbologies, with check digits added automatically and links to format-specific generators.
Code 39 encodes A–Z, 0–9, space and - . $ / + %.
Module width multiplier — larger values produce a wider barcode.
Height of the bars (in millimeters).
Print the encoded value as readable text under the barcode.

The Classic Industrial Symbology

Code 39, also written as Code 3 of 9, is one of the oldest barcodes still in everyday use. Defined in ISO/IEC 16,388, it encodes a set of 43 characters: the uppercase letters A through Z, the digits 0 through 9, the space, and the symbols dash, period, dollar, slash, plus, and percent. Each character is built from nine elements, three of which are wide, which is where the 3 of 9 name comes from. The data is framed by a start and stop pattern, traditionally shown as an asterisk on each side, so a scanner knows exactly where the code begins and ends. The symbology is self-checking, meaning its structure lets a scanner catch most misreads without a separate check digit. That simplicity and tolerance made Code 39 a fixture in industry, defense, and any setting where a rugged, easy to print barcode matters more than packing the most data into the least space.

Code 39 Compared With Code 128

Code 39 and Code 128 solve similar problems with different trade offs. Code 39 carries a limited set of 43 characters, all uppercase, and produces a wider barcode for the same data because each character takes more space. Code 128 encodes the full ASCII set, including lowercase letters and more symbols, and packs data far more tightly. So if you need lowercase text, many symbols, or a compact label, Code 128 wins on density. Where Code 39 holds its ground is simplicity and tolerance: it is self-checking and needs no mandatory check digit, and its wide bars stay readable even on rough printers and worn labels. Many legacy systems and industrial standards were built around it, so it remains the safe choice when an existing process already expects it. The right pick depends on your data and the systems that will read it rather than on which format is newer. For the denser alternative, see the Code 128 Barcode Generator, and for a general overview that spans several symbologies start with the Barcode Generator.

Typical Applications

Code 39 lives in places where reliability beats density. Manufacturers and warehouses use it on inventory and asset tags, where a forgiving format survives dust, scuffing, and budget printers. Government suppliers know it from defense standards such as LOGMARS and MIL-STD-1189, which built procurement labeling around it for decades. Automotive plants label parts and bins with it, libraries tag books, and offices print employee ID badges that scan at a door or a time clock. Healthcare teams put it on patient wristbands and equipment, where a self-checking code reduces the chance of a quiet misread. Retail is the main place you will not see it, since stores rely on numeric formats built for the register. The common thread across its homes is an environment that values a barcode anyone can generate, print, and scan without special tooling or a paid encoder. When your data is uppercase letters and digits, the volume is moderate, and you want a format with a long industrial track record, Code 39 is a natural fit.

Reliable Printing

Code 39 prints well even on modest equipment, but a few habits keep scan rates high. The wide-to-narrow ratio is the relationship between the thick and thin bars, usually set between two to one and three to one. Stay inside that range so scanners distinguish the two widths cleanly. Give the bars enough height that a scanner crossing at a slight angle still reads a full pattern. Leave a quiet zone, a band of blank space on each side, so the start and stop marks are easy to find. Because Code 39 is lower density, plan for a wider label than a Code 128 version of the same data would need, and check that it fits before a full run. Keep dark bars on a light background for strong contrast, and avoid printing over textures. Export the SVG for crisp scaling on sheet labels, or the PNG for fixed previews, then scan a test print at the real distance.

Encoding Within the Character Set

Working with Code 39 means staying inside its 43 character set. Use uppercase letters, since the format has no lowercase, and the digits 0 through 9. Beyond those, only the space and the symbols dash, period, dollar, slash, plus, and percent are valid. If your source data has lowercase text or characters outside this list, convert or strip them before generating, or move to a denser format that supports them. Keep your codes a consistent length and structure across a batch so scanning and sorting stay predictable downstream. Decide whether to display the human-readable text below the bars, which lets a person read the value when a scanner is not handy or the label is damaged. Validate the full string on screen before printing, then scan a sample to confirm the decoded value matches what you typed, character for character. A quick check at this stage costs a moment and saves a reprint when a stray lowercase letter or an unsupported symbol would otherwise slip onto a finished label.

The ones we answer the most.

Why does Code 39 need no check digit?

Code 39 is described as self-checking. Each character has a fixed internal structure of bars and spaces, and that structure makes a single misread element unlikely to produce another valid character. As a result, the scanner catches most errors from the pattern alone, without a separate check digit. You can still add an optional check character for extra assurance in demanding settings, but it is not required for the code to be valid and scannable.

Which characters can I encode?

Code 39 supports 43 characters: the uppercase letters A through Z, the digits 0 through 9, the space, and the symbols dash, period, dollar, slash, plus, and percent. It has no lowercase letters. If your data includes lowercase text or other symbols, convert it to uppercase or remove the unsupported characters first. For data that needs the full ASCII set, a denser format like Code 128 is the better choice.

When should I prefer Code 128 instead?

Choose Code 128 when you need lowercase letters, a wider range of symbols, or a more compact barcode for long data. Code 128 has higher density, so it fits more characters in less space, and it supports the full ASCII set. Code 39 is the better pick when you want maximum tolerance on rough printers, are tied to a legacy or defense standard that specifies it, and your data is already uppercase letters and digits.

What are the asterisks around the data?

The asterisks represent the start and stop pattern that frames every Code 39 barcode. They tell a scanner exactly where the code begins and ends, which is part of how the format stays reliable. The tool adds these framing marks automatically, so you do not type asterisks into your data. If you do include one, treat it only as the delimiter rather than as part of your encoded value.

Why is a Code 39 barcode wider than other formats?

Code 39 is a lower-density symbology, so each character takes more horizontal space than it would in a denser format like Code 128. Every character uses nine elements, three of them wide, which adds width. This is the trade for its simplicity and tolerance. When planning labels, allow for a wider barcode and confirm it fits the available space before printing a full batch.

Should I show the human-readable text?

Showing the text below the bars helps a person read or type the value when no scanner is at hand or the barcode is damaged. For asset tags, ID badges, and inventory labels this is usually worth keeping on. If space is tight or the value already appears elsewhere on the label, you can toggle the text off. The tool lets you decide either way.