Barcode Ready
← Barcode Guides

Barcode Fonts Explained: Code 39, Code 128 and UPC

A barcode font is a font whose characters are bar patterns, so typing text and applying the font produces a barcode. It works well for Code 39 because the text maps almost directly to the bars. For Code 128 and UPC/EAN, the text has to be encoded first, which is where most barcode font problems come from.

How a barcode font works

Each glyph in the font is a slice of a barcode: a character, or part of one. When you put glyphs side by side, you get a complete symbol. The scanner never knows a font was involved. It just sees bars and spaces.

That means the font has to produce the entire symbol, including parts the user does not normally type: the start pattern, the stop pattern, the check digit and, for EAN, the center guard bars.

Code 39 fonts

Code 39 is the simplest case. You type an asterisk, the data, then another asterisk:

*ABC123*

The asterisks are the start and stop characters. Without them, scanners will not read the barcode. Set the font large and avoid lowercase letters, which are not part of Code 39. Many scanners work without a check digit, so you can skip it unless your system calls for one.

Code 128 fonts

Code 128 is more efficient but its encoding is not a simple mapping. A valid symbol needs:

  1. a start character that selects subset A, B or C,
  2. the data characters, which can be switched between subsets mid-symbol,
  3. a check character calculated from the start value and data,
  4. a stop character.

Some fonts reassign the check and stop to ordinary-looking characters, so you cannot just type the data. You usually need a macro, an add-in, a formula or a small encoder program that converts your text to the string the font expects. Vendors differ on character mapping, so use the encoder that matches your font.

UPC and EAN fonts

UPC-A and EAN-13 fonts split the number into left and right halves, with different bar patterns for each, plus guard bars. The check digit has to be correct and the encoding tool inserts the guards. If you only need a product barcode or two, a generator is easier than a font. See the UPC generator or the EAN-13 generator.

Common pitfalls

Fonts versus images

FontImage (PNG or SVG)
Needs installYesNo
Works across computersOnly if font is presentYes
Updates with cell dataYesNo
Code 128 and EAN supportNeeds encoderBuilt in
Print qualityDepends on font and printerCrisp at any size with SVG

Fonts make sense inside a spreadsheet or report template where the data changes constantly and you control every computer. For everything else, images are less work. Barcode Ready's main generator draws any supported symbology in your browser and exports an SVG or PNG; nothing is uploaded. For a long list, the bulk barcode generator does the same for every row.

Checklist

  1. Pick the symbology your scanner and customer expect.
  2. For Code 39, add the asterisks. For Code 128 or EAN, use the encoder that comes with the font.
  3. Install the font on every machine that will print.
  4. Print at actual size and scan a test label.

Try it