ZPLToolkit

^BU

UPC-A Bar CodePreview: partial

The North American retail bar code: eleven digits plus a check digit, in a fixed 95-module symbol.

Syntax

^BUo,h,f,g,e

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
hBar height in dots, up to 9999.1 to 9999 dotsHeight set by ^BY
fPrints the digits underneath the bars as text.Y or N — print the human-readable lineY
gMoves those digits above the bars instead.Y or N — put that line above the barsN
eIncludes the check digit in the printed line.Y or N — print the check digitY

How it works

^BU prints UPC-A, the symbology on consumer products in the United States and Canada. It takes 11 digits and appends a check digit, or accepts all 12 and verifies the last one.

UPC-A and EAN-13 are the same symbology underneath — a UPC-A is an EAN-13 whose first digit is zero — which is why modern scanners read both and why a UPC-A is also 95 modules wide. What differs is how the human-readable line is laid out and how the numbers are allocated.

The `e` parameter controls whether the check digit is printed in that line. It is on by default, and retail expects to see it: the digits under the bars are what a cashier keys in when the scan fails.

Example

ZPL
^XA
^BY3
^FO60,50^BUN,80,Y,N^FD012345678905^FS
^XZ

Rendering…

A twelve-digit UPC-A with its check digit already included.
Open in the viewer

How the preview on this site handles it

Drawn with a real UPC-A encoder, rotation included; a wrong digit count is drawn as a hatched red box. The guard bars are not extended below the symbol, and the human-readable line is drawn as one centred row rather than with the first and last digits set outside the bars.

Common mistakes

  • Sending 12 digits with a check digit your own code computed with the wrong algorithm. The printer rejects the field rather than printing a wrong symbol.
  • Dropping the leading zero. A UPC-A stored as 11 digits in a database is often missing the zero the symbology expects.
  • Using ^BU for a shipping or internal code. It is a retail identifier; anything else belongs in ^BC.

See also