^BK ANSI Codabar Bar Code

Barcodes ZPL caret command

Prints an ANSI Codabar barcode (also called NW-7) of digits and a few control characters, with a chosen start and stop character.

Format ^BKo,e,h,f,g,k,l

^BK parameters

Parameters of ^BK
ParameterMeaningAccepted valuesDefault
oorientationp. 118

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.

echeck digitp. 118

Check digit setting; the guide gives only a fixed value and no description of its effect.

The guide lists N as a fixed value, not as a choice.
  • NThe only value; the guide calls it fixed.
N
hbar code height (in dots)p. 118

Height of the bars in dots.

1 to 32000 dots

The height set by ^BY.

fprint interpretation linep. 118

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. 118

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

The printed value list shows Y twice (as 'Y = no' and 'Y = yes'); the first is read as N.
  • Yabove the code
  • Nnot above the code
N
kdesignates a start characterp. 118

The character the code starts with.

  • Astart character A
  • Bstart character B
  • Cstart character C
  • Dstart character D
A
ldesignates stop characterp. 119

The character the code stops with.

  • Astop character A
  • Bstop character B
  • Cstop character C
  • Dstop character D
A

^BK notes and gotchas

  • Interaction

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

    p. 190
  • Note

    The guide names uses such as libraries, the medical industry and overnight package delivery companies. It lists the other names of the code as USD-4, NW-7 and 2 of 7, and says it was first developed for retail price labeling.

    p. 118
  • Note

    Each character is made of seven elements, four bars and three spaces. The code has two character sets, numeric and control (start and stop) characters. The illustration on page 119 shows the digits 0 to 9, the control characters - : . $ / +, and the start/stop characters A, B, C and D.

    pp. 118, 119
  • Note

    The print ratio can be 2.0:1 to 3.0:1, so the ratio from ^BY applies. The field data is limited to the width of the label, or its length if rotated.

    pp. 118, 148, 1588
  • Note

    In the guide's example the field data holds only digits, with A as both start and stop character, and the printed interpretation line in the illustration shows A before and after the digits. The entry text does not say whether the start and stop characters are written in the field data.

    p. 119
  • Guide issue

    The g parameter's value list is printed 'Y = no, Y = yes'. Both entries show Y; the record reads the first as N, as in the other barcode commands, and keeps the default N.

    p. 118

^BK example

example.zplZPL
^XA
^FO40,40^BKN,N,80,Y,N,C,D^FD40291^FS
^XZ

An ANSI Codabar barcode of the digits 40291, not rotated and 80 dots high, interpretation line below the code, with C as the start character and D as the stop character. The e parameter takes its only value, N.

Guides that use ^BK

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 118, 119, 148, 190, 201, 1587, 1588.

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.