ZPLToolkit

^B3

Code 39 Bar CodePreview: partial

The workhorse of industrial labelling: uppercase letters, digits and a handful of symbols, readable by every scanner ever made.

Syntax

^B3o,e,h,f,g

Parameters

ParameterDescription and accepted valuesIf omitted
oRotation of the bar code on the label.N normal, R 90°, I 180°, B 270°Last ^FW value, else N
eAdds the optional mod-43 check digit. Most scanners do not require it, and enabling it changes what the scanner reports.Y or N — add a mod-43 check digitN
hBar height in dots. Overrides the height set by ^BY for this field only.1 to 32000 dotsHeight set by ^BY
fPrints the data underneath the bars as text.Y or N — print the human-readable lineY
gMoves that text above the bars instead.Y or N — put that line above the barsN

How it works

^B3 prints Code 39, the symbology almost every scanner reads without being configured for it. That universality is why it still appears on work orders, asset tags and internal logistics labels decades after denser alternatives arrived.

Its character set is deliberately small: A–Z, 0–9, space, and - . $ / + %. Lowercase letters are not part of it. The printer frames the data with the * start and stop characters on its own, so you do not put them in ^FD.

The price of that compatibility is width. A character costs roughly 16 narrow modules, so at ^BY2 a ten-character code is already about 380 dots — nearly two inches at 203 dpi. When a Code 39 does not fit, the answer is usually Code 128 (^BC), which encodes the same data in about half the space.

Example

ZPL
^XA
^BY2,3,80
^FO60,50^B3N,N,80,Y,N^FDZPL-TOOLKIT^FS
^XZ

Rendering…

Code 39 at a module width of 2 dots, with the human-readable line below.
Open in the viewer

How the preview on this site handles it

Drawn with a real Code 39 encoder, so it scans, and rotation is applied. One approximation remains: the wide-to-narrow ratio from ^BY is not, so the preview always uses 3:1. Data outside the Code 39 character set cannot be encoded and is drawn as a hatched red box instead of a bar code that would not scan.

Common mistakes

  • Sending lowercase data. Code 39 has no lowercase, and what the printer does with it is not something to rely on — uppercase the value before it reaches the label.
  • Assuming it fits. Code 39 is the widest common symbology; check the label at the real ^BY module width before committing a template.
  • Adding your own asterisks to ^FD. The printer already adds the start and stop characters, and the extra pair prints as data.

See also