Why Code 128 is the usual choice for your own labels
Code 128 was designed in 1981 to hold the whole ASCII character set in a small space. It is not tied to a product database: whatever you encode is what a scanner returns, which is why it is used on shipping labels, parcel tracking numbers, warehouse bins, library items, asset tags and lab samples.
Most barcode scanners read it out of the box. Unlike EAN and UPC, there is no registry, no licence and no fixed length. You can use order numbers such as ORDER-2026-04817, a SKU with letters and digits, or a serial number.
A variant called GS1-128 uses Code 128 to carry several GS1 data fields in one label, such as a batch, an expiry date and a pallet number. This page makes plain Code 128 and does not build GS1-128 labels.
Subsets, digit pairs and how wide the barcode gets
Code 128 has three subsets, called A, B and C. Subset A holds capital letters, digits and control characters, subset B holds capital and lowercase letters, digits and punctuation, and subset C holds pairs of digits. The barcode can switch between them partway through, and the generator picks the shortest combination for your text.
That is why digits are cheap: in subset C two digits fit in one symbol. Typing 12345678 makes a barcode 79 bars wide, while the same number of letters, ABCDEFGH, is wider. A symbol is 11 bars wide, and the barcode adds a start symbol, a check symbol and a longer stop symbol.
Long text makes a wide barcode, and a wide barcode needs a wide label or a smaller bar width. Shorter references scan more easily, especially from a distance or with a phone camera.
Reading it back
A scanner returns exactly the characters you encoded and does not send the start, check or stop symbols. If a scanned value has an extra character at the end, that is usually the scanner or its software adding an Enter or Tab key press, which is a setting of the scanner and not a part of the barcode.
Code 128 can only hold plain ASCII here. Accented letters such as é, other alphabets and emoji will not fit. If you need those, use a QR code.