The ^BC command generates a Code 128 barcode — one of the most widely used linear barcode formats. Code 128 can encode the full ASCII character set and is extremely compact. It is the standard for shipping labels (including FedEx, UPS, and USPS), inventory systems, and supply chain applications.
^BC automatically switches between three internal subsets (A, B, and C) to minimize barcode length. Subset C is especially efficient for pairs of digits, making it ideal for numeric-heavy data like tracking numbers.
The barcode height is specified in dots. The human-readable interpretation line (text printed below the barcode) is optional and controlled by the fourth parameter.
For GS1-128 / UCC-EAN-128 barcodes used in retail and logistics, pass the Application Identifier data in the ^FD field and set the mode parameter to U in ^BC.
Syntax
^BCo,h,f,g,e[,m]
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| o | N | R | I | B | N | Orientation: N = normal, R = rotated 90°, I = inverted 180°, B = bottom-up 270°. |
| h | integer | 10 | Bar code height in dots. |
| f | Y | N | Y | Print interpretation line (human-readable text below barcode). |
| g | Y | N | N | Print interpretation line above the barcode. |
| e | Y | N | N | UCC check digit: Y = add check digit, N = no check digit. |
| m | N | U | A | D | N | Mode: N = standard, U = UCC case mode, A = auto, D = UCC/EAN-128. |
Examples
Standard Code 128 with human-readable text
Try in Viewer^XA ^FO50,50^BY2,3,90^BCN,90,Y,N,N^FD123456789012^FS ^XZ
Code 128 rotated 90 degrees
Try in Viewer^XA ^FO50,50^BY2,3,100^BCR,100,Y,N,N^FDABC-12345^FS ^XZ
Common Mistakes
- !Omitting the ^BY command before ^BC — ^BY sets bar width ratio and height defaults that ^BC inherits.
- !Encoding characters not in the Code 128 character set — most control characters require subset A.
- !Setting height (h) smaller than the minimum readable by your scanner — most scanners need at least 50 dots at 203 DPI.