CODABAR Generator
Generate Codabar barcodes online with custom start/stop characters, adjustable sizing, and instant PNG/SVG export. Supports full Codabar charset.
About
Codabar is a self-checking linear barcode symbology defined in ANSI/AIM BC3-1995. It encodes characters 0 - 9 plus six special symbols (−, $, :, /, ., +) using four bars and three interleaved spaces per character, with each element being either narrow or wide at a ratio of 1:3. Start and stop characters (A, B, C, D) frame the data payload and are mandatory for scanner decode. Misconfigured start/stop pairs or illegal characters cause read failures at the scanner, producing costly re-labeling in library, blood-bank, and logistics workflows where Codabar remains an active standard.
This tool generates specification-compliant Codabar barcodes with configurable module width, bar height, and quiet zones. The encoding uses no check digit by default, matching the original Codabar specification. If your application requires a modulo-16 check digit, calculate it externally and append it to the data field before the stop character. The tool approximates rendering assuming a thermal or laser print resolution; actual scan reliability depends on print DPI and substrate contrast.
Formulas
Each Codabar character maps to a sequence of 7 or 8 elements (alternating bars and spaces). The total barcode width W is computed as:
Where Q = quiet zone width (minimum 10 narrow modules per specification). Ei = sum of element widths for character i, where narrow = 1 module and wide = R modules (R is the wide-to-narrow ratio, typically 2 - 3). G = inter-character gap of 1 narrow module. n = total encoded characters including start and stop.
The encoding is self-checking because no single printing defect can transpose one valid character into another. Each character has exactly 2 or 3 wide elements among its 7 elements, providing a Hamming distance sufficient for error detection without a mandatory check digit.
Reference Data
| Character | Pattern (B=Bar, S=Space) | Binary (N=Narrow, W=Wide) | Element Count |
|---|---|---|---|
| 0 | BSBSBSB | NNNNNWW | 7 |
| 1 | BSBSBSB | NNNNWWN | 7 |
| 2 | BSBSBSB | NNNWNNW | 7 |
| 3 | BSBSBSB | WWNNNNN | 7 |
| 4 | BSBSBSB | NNWNNWN | 7 |
| 5 | BSBSBSB | WNNNNWN | 7 |
| 6 | BSBSBSB | NWNNNNW | 7 |
| 7 | BSBSBSB | NWNNWNN | 7 |
| 8 | BSBSBSB | NWNWNNN | 7 |
| 9 | BSBSBSB | WNNWNNN | 7 |
| − | BSBSBSB | NNNWWNN | 7 |
| $ | BSBSBSB | NNWWNNN | 7 |
| : | BSBSBSB | WNNNWNW | 7 |
| / | BSBSBSB | WNWNNNW | 7 |
| . | BSBSBSB | WNWNWNN | 7 |
| + | BSBSBSB | NNWNWNW | 7 |
| A (start/stop) | BSBSBSB | NNWWNWN | 7 |
| B (start/stop) | BSBSBSB | NWNWNWN | 7 |
| C (start/stop) | BSBSBSB | NNNWNWWN | 8 |
| D (start/stop) | BSBSBSB | NNNWWNWN | 8 |