^BU
UPC-A Bar CodePreview: partialThe North American retail bar code: eleven digits plus a check digit, in a fixed 95-module symbol.
Syntax
^BUo,h,f,g,eParameters
| Parameter | Description and accepted values | If omitted |
|---|---|---|
| o | Rotation of the bar code on the label.N normal, R 90°, I 180°, B 270° | Last ^FW value, else N |
| h | Bar height in dots, up to 9999.1 to 9999 dots | Height set by ^BY |
| f | Prints the digits underneath the bars as text.Y or N — print the human-readable line | Y |
| g | Moves those digits above the bars instead.Y or N — put that line above the bars | N |
| e | Includes the check digit in the printed line.Y or N — print the check digit | Y |
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
^XA
^BY3
^FO60,50^BUN,80,Y,N^FD012345678905^FS
^XZRendering…
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.