Authored by RFID.me Last updated Editorial policy

Plain English

Draws a 1D barcode at the specified position. The "type" string selects the symbology — 30 values are valid per TSPL2 PG §BARCODE, covering Code 128, Code 39, EAN/UPC families, CODABAR, ITF, MSI, Plessey, and US/Chinese postal codes. The engine validates the type at parse time and emits a "did you mean" diagnostic on unknown values.

When to use

When you need any 1D barcode — shipping labels, product IDs, inventory tracking. Pick the symbology with the "type" parameter; for 2D codes use QRCODE, DMATRIX, PDF417, AZTEC, etc.

Syntax

BARCODE x,y,"type",height,readable,rotation,narrow,wide,"data"

Parameters

ParameterDescription
x
Horizontal position in dots
y
Vertical position in dots
type
Barcode symbology. One of 30 values per TSPL2 PG §BARCODE p33–37.
  • "128" - Code 128 (auto-subset)
  • "128M" - Code 128 manual: preserves explicit A/B/C starts and switches, SHIFT and FNC1–4 through canonical code128-manual and SVG. Default subset B; !096–!105 controls. Invalid data is diagnosed.
  • "EAN128" - GS1-128 (EAN-128): canonical gs1-128 preview with leading FNC1 and GS separators. Native generation uses EAN128 for simple AI data and 128M with explicit !102 controls for FNC1 separators.
  • "25" - Interleaved 2 of 5 (I2of5)
  • "25C" - Interleaved 2 of 5 with an automatic Mod-10 check digit; canonical i2of5-mod10 preserves native generation and SVG preview. Supply an odd number of digits without a precomputed check digit. Integer narrow/wide ratios 1:2, 1:3 or 2:5; invalid data or widths are errors.
  • "39" - Code 39 Full ASCII on TSPL2: native generation and canonical code39-full-ascii SVG preview, without checksum. Literal printable ASCII only (quotes and printer string expressions rejected); widths 1:2, 1:3 or 2:5. Legacy TSPL and PLUS printer behavior differs.
  • "39C" - Code 39 with generated Mod-43 checksum: native generation and canonical code39-mod43 SVG preview. Supply uppercase payload without start/stop or a precomputed checksum; standard alphabet only (full ASCII rejected), with narrow/wide ratios 1:2, 1:3 or 2:5.
  • "39S" - Standard Code 39 on TSPL2: native generation and canonical code39 SVG preview, without checksum. Non-empty uppercase standard alphabet only, without start/stop characters; widths 1:2, 1:3 or 2:5. See TSPL2 manual p. 56.
  • "93" - Code 93
  • "EAN13" - EAN-13
  • "EAN13+2" - EAN-13 with EAN-2 supplement: canonical ean13+2 and validated composite SVG preview/native generation. Exactly 12 payload digits followed by 2 add-on digits; automatic EAN check digit. Equal widths 1–8 dots, height greater than 8X, readable 0/1, left alignment. 7X supplement gap; guard extensions and separate supplement text.
  • "EAN13+5" - EAN-13 with EAN-5 supplement: canonical ean13+5 and validated composite SVG preview/native generation. Exactly 12 payload digits followed by 5 add-on digits; automatic EAN check digit. Equal widths 1–8 dots, height greater than 8X, readable 0/1, left alignment. 7X supplement gap; guard extensions and separate supplement text.
  • "EAN8" - EAN-8
  • "EAN8+2" - TSPL EAN-8 with EAN-2 supplement (non-standard GS1 combination): canonical ean8+2 and validated composite SVG preview/native generation. Exactly 7 payload digits followed by 2 add-on digits; automatic EAN check digit. Equal widths 1–8 dots, height greater than 8X, readable 0/1, left alignment. 7X supplement gap; guard extensions and separate supplement text.
  • "EAN8+5" - TSPL EAN-8 with EAN-5 supplement (non-standard GS1 combination): canonical ean8+5 and validated composite SVG preview/native generation. Exactly 7 payload digits followed by 5 add-on digits; automatic EAN check digit. Equal widths 1–8 dots, height greater than 8X, readable 0/1, left alignment. 7X supplement gap; guard extensions and separate supplement text.
  • "CODA" - Codabar: native generation and canonical codabar SVG preview, preserving A/B/C/D start/stop characters. Digits and -$:/.+ payload; no generated checksum. Integer narrow/wide ratios 1:2, 1:3 or 2:5. Empty data, misplaced guards and unsupported widths are errors.
  • "POST" - USPS POSTNET: 5, 9 or 11 payload digits, automatic Mod-10 check digit, 1:1 widths. Validated height-modulated preview and native generation (left alignment, readable 0/1); canonical postnet also accepts validated check digits.
  • "UPCA" - UPC-A
  • "UPCA+2" - UPC-A with EAN-2 supplement: canonical upca+2 and validated composite SVG preview/native generation. Exactly 11 payload digits followed by 2 add-on digits; automatic UPC check digit. Equal widths 1–8 dots, height greater than 8X, readable 0/1, left alignment. 9X supplement gap; UPC guard extensions and separate supplement text.
  • "UPCA+5" - UPC-A with EAN-5 supplement: canonical upca+5 and validated composite SVG preview/native generation. Exactly 11 payload digits followed by 5 add-on digits; automatic UPC check digit. Equal widths 1–8 dots, height greater than 8X, readable 0/1, left alignment. 9X supplement gap; UPC guard extensions and separate supplement text.
  • "UPCE" - UPC-E
  • "UPCE+2" - UPC-E with EAN-2 supplement: canonical upce+2 and validated composite SVG/native generation. Exactly 6 payload digits plus 2 supplement digits; number system 0 and automatic check digit. Equal widths 1–8, height greater than 8X, readable 0/1, left alignment. 7X supplement gap; UPC-E guards and separate text.
  • "UPCE+5" - UPC-E with EAN-5 supplement: canonical upce+5 and validated composite SVG/native generation. Exactly 6 payload digits plus 5 supplement digits; number system 0 and automatic check digit. Equal widths 1–8, height greater than 8X, readable 0/1, left alignment. 7X supplement gap; UPC-E guards and separate text.
  • "CPOST" - China Post 25 (Data Logic 2 of 5): native preview; 1–113 ASCII digits, no automatic check digit, narrow/wide 3/7 dots
  • "MSI" - MSI Plessey
  • "MSIC" - MSI Plessey with one automatic Mod-10 check digit; canonical msi-mod10 preserves checksum semantics in SVG preview and native generation. Non-empty digits only; invalid data is an error.
  • "PLESSEY" - Plessey (UK)
  • "ITF14" - ITF-14: validated 13-digit native payload with automatic GTIN check digit; GS1 preview at 1:3 or 2:5 widths, horizontal 2X bearer bars and 10X side quiet zones. Native generation; readable modes 0/1 and default left alignment. Canonical itf14 also validates complete 14-digit GTINs. The manual 1:2 ratio is outside this GS1 preview profile.
  • "EAN14" - EAN-14: GS1-128 AI 01 profile; exactly 13 numeric payload digits, automatic GTIN check digit, 1:1 widths. Canonical ean14 supports validated 14-digit GTINs; native generation removes the check digit. Validated preview; not ITF-14.
  • "11" - Code 11: native generation and canonical code11 SVG preview. Digits and hyphen; automatic C checksum, plus K for 10 or more characters. Integer narrow/wide ratios 1:2, 1:3 or 2:5. Empty data, unsupported characters and widths are errors.
height
Barcode height in dots
readable
Human-readable text rendering mode
  • 0 - No human-readable text
  • 1 - Text below the barcode
  • 2 - Text above the barcode
  • 3 - Text both above and below
rotation
Rotation in degrees
  • 0 - No rotation (left to right)
  • 90 - 90° clockwise
  • 180 - 180° (upside down)
  • 270 - 270° clockwise (90° counter-clockwise)
narrow
Narrow bar width in dots
wide
Wide bar width in dots
data
The data to encode (in double quotes)

Example

BARCODE 50,200,"128",80,1,0,2,4,"ABC-12345"

Code 128 barcode with human-readable text below

Try it in the playground View all TSPL commands