GS1-128 barcode generator

GS1-128 is Code 128 with a grammar bolted on. The bars are the same; what changes is that the data is no longer an opaque string but a sequence of fields, each introduced by an application identifier that says what the next characters mean and how many of them to read. (01) is a GTIN and always fourteen digits. (17) is an expiry date and always six. (10) is a batch and runs up to twenty until something tells it to stop. That grammar is why a receiving system can pull an expiry date out of a symbol it has never seen before, and it is also why a symbol with the right digits in the wrong structure is worse than no symbol at all.

Appearance
Size
Caption
Caption position
Caption alignment
Colours

462 × 296 px in the PNG

Size units

Specification

Character set
letters and digits
Length
from 1 to 48 characters
Check digit
not used by this symbology

Where it is used

  • Logistic labels on pallets and cases, where the SSCC behind AI (00) is the licence plate that ties the physical unit to its despatch advice
  • Food and pharmaceutical cases that must carry batch and expiry alongside the product number, because a recall works by batch and not by product
  • Variable measure goods sold by weight, where AI (310n) carries net weight with the decimal position encoded in the identifier itself
  • Serialised units where AI (21) adds a serial number to the GTIN, making each individual item distinguishable rather than merely each product line

How it compares

Against plain Code 128 the difference is not the bars but the contract. Code 128 will encode whatever you hand it, and the meaning lives in an agreement between you and whoever reads it; GS1-128 puts the meaning in the data itself, which is what allows a pallet to be understood by a warehouse that has never spoken to you. That comes at a cost in width: every identifier is two to four characters that carry no payload, so a symbol holding GTIN, batch and expiry is meaningfully longer than the same digits packed as bare Code 128. Against ITF-14 the trade is the opposite one. ITF-14 carries a GTIN and nothing else, prints coarsely and survives corrugated board; GS1-128 carries everything else but wants a printed label rather than direct flexography, because its narrowest elements are finer. In practice a case often gets both: ITF-14 for the case number, GS1-128 for the batch and date.

Common mistakes

  • Typing the parentheses as data. Round brackets around an application identifier are a human-readable convention printed under the bars — they are not encoded. What separates fields in the symbol is FNC1, a non-data character the generator inserts for you. Encode literal brackets and you produce a symbol whose data begins with a punctuation mark, which no GS1 reader will parse as an identifier.
  • Omitting the separator after a variable-length field. Fixed-length identifiers need nothing after them because their length is known — (01) is always followed by exactly fourteen digits. Variable ones, such as (10) batch or (21) serial, run until a separator says stop. Leave it out and the field that follows is swallowed into the batch number, which then looks plausible and is wrong.
  • Padding a GTIN to the wrong width. AI (01) takes fourteen digits always. A GTIN-13 goes in right-justified with a leading zero, a GTIN-12 with two. Left-justifying it, or padding on the right, produces a number that passes the check digit test as a different item — the failure mode where the symbol scans perfectly and identifies somebody else's product.
  • Writing dates in the local order. AI (11), (15) and (17) all take six digits as YYMMDD, and nothing in the symbol distinguishes 010203 read as 3 February 2001 from the same digits meant as 2 January 2003. A day of 00 is legal and means the last day of that month, which is the one exception worth knowing.
  • Printing it as small as a retail barcode. On a logistic label the X-dimension runs from 0.495 mm upwards, roughly one and a half times the retail module, because the label is read across a dock rather than under a glass. Shrinking a GS1-128 to fit a design grid is the most common reason a pallet label has to be scanned twice.

Frequently asked questions

What is the difference between GS1-128 and UCC/EAN-128?
Nothing but the name. The symbology was renamed GS1-128 when the UCC and EAN organisations merged into GS1; older documentation, and a good deal of installed software, still calls it UCC/EAN-128 or simply EAN-128. If a specification asks for any of those, this is the symbol it means.
Do I need a GS1 prefix to use it?
For anything that leaves your own four walls, yes. The identifiers are only meaningful because the numbers behind them are globally unique, and that uniqueness comes from a company prefix licensed to you. An SSCC or a GTIN built from digits you invented may already belong to another company, and the receiving system will find their record rather than yours.
How many fields can one symbol hold?
As many as fit, but fitting is the real limit. GS1 caps a symbol at 48 encoded characters, and each identifier spends two to four of them before any payload. In practice GTIN plus batch plus expiry is comfortable, GTIN plus batch plus expiry plus serial plus weight is not, and the usual answer is a second symbol on the same label rather than one that has been shrunk until it fails.
Why does my symbol look wider than a Code 128 with the same digits?
Because it is carrying more than the digits. Every application identifier and every separator is encoded, and none of them is part of your data. That overhead is the price of a symbol that explains itself to a reader it has never met, and it is the reason a case that only needs a product number is better served by ITF-14.
Can I put a GS1-128 on a consumer pack?
It will scan, but it will not be priced. Point-of-sale systems look for a GTIN-13 or GTIN-12 in a retail symbol and are not obliged to parse application identifiers at the till. The consumer unit gets an EAN-13 or UPC-A; GS1-128 belongs on the case, the pallet and the despatch label.