^B2 Interleaved 2 of 5 Bar Code

Barcodes ZPL caret command

Prints an Interleaved 2 of 5 barcode, a numeric-only linear code, from the data of the next field.

Format ^B2o,h,f,g,e,j

^B2 parameters

Parameters of ^B2
ParameterMeaningAccepted valuesDefault
oorientationp. 68

Direction in which the barcode is rotated.

  • Nnormal
  • Rrotated 90 degrees (clockwise)
  • Iinverted 180 degrees
  • Bread from the bottom up, 270 degrees

The current ^FW value.

hbar code height (in dots)p. 68

Height of the bars in dots.

1 to 32000 dots

The height set by ^BY.

fprint interpretation linep. 68

Whether the human-readable text of the data is printed with the barcode.

  • Yprint the interpretation line
  • Ndo not print it
Y
gprint interpretation line above codep. 68

Whether the interpretation line is printed above the barcode instead of below it.

  • Yabove the code
  • Nnot above the code
N
ecalculate and print Mod 10 check digitpp. 68, 69

Whether the printer calculates a Mod 10 check digit and prints it as part of the code.

  • Ycalculate and print the check digit
  • Ndo not
N

^B2 notes and gotchas

  • Gotcha

    The total number of digits must be even. If an odd number of digits is received, the printer puts a leading 0 in front. The guide does not say whether this is checked before or after a Mod 10 check digit is added.

    p. 69
  • Interaction

    Field data is limited by ^FD to 3072 bytes and cannot contain the command prefix characters ^ and ~ directly.

    p. 190
  • Note

    The code accepts print ratios from 2.0:1 to 3.0:1, so the ratio set with ^BY applies to it.

    pp. 68, 148, 1587
  • Note

    The field data is limited to the width of the label (or its length, if the barcode is rotated).

    p. 68
  • Note

    The code uses the Mod 10 check-digit scheme for error checking. The guide's Mod 10 section describes the calculation in five steps.

    pp. 69, 1591
  • Note

    On the EAN-13 page the guide says that Interleaved 2 of 5 is the code to use for UCC and EAN 14.

    p. 109
  • Guide issue

    The Format line is printed as ^B2o,h,f,g,e,j, but the parameter table describes only o, h, f, g and e. The guide gives no meaning, accepted values or default for j.

    p. 68

^B2 example

example.zplZPL
^XA
^FO40,40^B2N,80,Y,N,N^FD12345678^FS
^XZ

An Interleaved 2 of 5 barcode of eight digits (an even count), not rotated, 80 dots high, with the interpretation line printed below it and no added check digit.

Guides that use ^B2

BarcoderX is a .NET SDK for thermal labels and barcodes. See the barcode types it covers.

Source Zebra, ZPL II, ZBI 2, Set-Get-Do, Mirror, WML Programming Guide, P1134473-11EN Rev A, 2026/07/05, pages 68 to 70, 109, 148, 190, 208, 1587, 1591.

Written by BarcoderX in its own words. Checked against the guide on 2026-11-14.

ZPL and ZPL II are trademarks of Zebra Technologies Corporation. This reference is written by BarcoderX in its own words from Zebra's published programming guide. BarcoderX is an independent product and is not affiliated with, endorsed by or sponsored by Zebra Technologies.