Introduction
Codabar is a linear barcode symbology developed in 1972 by Pitney Bowes Corporation. It encodes 16 characters (digits 0-9 and the six symbols dash, dollar, colon, slash, period, plus) plus four start and stop characters (A, B, C, D). Codabar is self-checking, meaning a single print defect cannot transform one valid character into another, and it supports an optional modulo-16 check digit. Despite being technically obsolete, Codabar remains in use for blood bank labels, library cards, and FedEx airbills. This generator produces scannable Codabar barcodes as SVG images entirely in your browser.
What this tool does
- Generates scannable Codabar barcodes from digit and symbol input.
- Supports the four start/stop characters A, B, C, D for application identification.
- Optionally appends a modulo-16 check digit for error detection.
- Renders the barcode as an SVG image using the bwip-js library.
- Validates input and reports errors for invalid characters.
How this tool works
Enter data (digits and the symbols - $ : / . +) into the input field. Select start and stop characters from A, B, C, D. Optionally enable the modulo-16 check digit, which is computed from the data characters and inserted before the stop character. The tool builds the full Codabar string (start + data + optional check + stop), passes it to the bwip-js library, and renders the barcode as an SVG image. The output field shows the full Codabar string, and the preview panel displays the rendered barcode. All processing happens client-side.
How Codabar barcodes work
Codabar encodes each character using seven elements: four bars and three spaces. The 12 basic symbols (digits 0-9, dash, and dollar) use all combinations of one wide bar and one wide space. The four additional symbols (colon, slash, period, plus) use three wide bars and no wide spaces. The four start/stop characters (A, B, C, D) use one wide bar and two wide spaces. Because each character uses exactly one or three wide elements out of seven, Codabar is self-checking: a single print defect that widens or narrows one element cannot turn one valid character into another. The optional modulo-16 check digit is computed by summing the values of all data characters (digits 0-9 have values 0-9; dash, dollar, colon, slash, period, plus have values 10-15; start/stop characters have values 16-19) and taking the complement modulo 16. The check digit character is then selected from the same value table. In blood banking, the start/stop character combination identifies the barcode type: A...B for donation numbers, C...D for component codes, D...D for expiration dates. The industry is transitioning to ISBT 128 (based on Code 128), but many blood banks still use Codabar during the migration.
How to use this tool
- Enter the data to encode (digits and the symbols - $ : / . +).
- Select start and stop characters (A, B, C, or D).
- Optionally enable the modulo-16 check digit.
- The full Codabar string and rendered barcode appear below the input.
- Right-click the barcode image to save it as an SVG file.
Real-world examples
Library card number
Data: `12345678`, start: A, stop: A. The tool generates a Codabar barcode suitable for a library patron card, with the full string A12345678A.
Blood bank donation number
Data: `W1234567`, start: A, stop: B. The A...B start/stop combination identifies this as a donation number in blood banking conventions.
With check digit
Data: `12345`, start: A, stop: A, check digit enabled. The tool computes the modulo-16 check digit and inserts it before the stop character, producing a string like A12345XA where X is the check character.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| Codabar | O(n) — 7 elements per character | Blood banks, libraries, FedEx airbills |
| Code 39 | O(n) — 9 elements per character | Industrial labels, logistics |
| Code 128 | O(n) — compact, full ASCII | Modern shipping, ISBT 128 blood banking |
| EAN-13 | O(n) — fixed 13 digits | Retail products worldwide |
Limitations or considerations
Codabar encodes only 16 characters (digits and six symbols) plus start/stop markers. It does not support lowercase letters or full ASCII. The symbology is technically obsolete and being replaced by Code 128 (ISBT 128 in blood banking). The optional modulo-16 check digit detects single-character errors but not transpositions. The generated SVG is suitable for printing at the rendered scale; for production use, verify with a physical scanner.
Frequently asked questions
Is Codabar still used?
Yes. Codabar remains in use for blood bank labels, some library cards, and FedEx airbills. The blood banking industry is transitioning to ISBT 128 (based on Code 128), but many facilities still use Codabar during the migration.
What characters can Codabar encode?
Digits 0-9 and the six symbols dash, dollar, colon, slash, period, plus. The four letters A, B, C, D are used only as start and stop markers and do not appear in the data portion.
What is the modulo-16 check digit?
It is an optional check character computed by summing the values of all data characters (0-19) and taking the complement modulo 16. The check digit character is inserted before the stop character and detects single-character substitution errors.
Why are there four start/stop characters?
The start/stop combination can convey application information. In blood banking, A...B identifies a donation number, C...D a component code, and D...D an expiration date. This lets a single scanner distinguish barcode types without reading the data.
Conclusion
The Codabar Barcode Generator produces scannable Codabar barcodes for blood bank, library, and shipping applications. It supports all four start/stop characters, an optional modulo-16 check digit, and renders output as SVG using the bwip-js library. While Codabar is being superseded by Code 128 in many industries, it remains an important legacy symbology with a large installed base.