HRI is not the same as other text on the pack
GS1 separates two kinds of text on an object:- HRI is the data that is encoded in the barcode, written out.
- Non-HRI text is everything else printed nearby. It may or may not also be encoded.
The rules that shape the generator
1. The text follows the encoding order
HRI placed together next to the barcode “SHALL always follow the sequence of the encoded data in the barcode” (4.14, general rule 1c). The order is not alphabetical, not numeric, and not the order that looks nicest. It is the order of the data inside the symbol. For a GS1 Digital Link QR code, that is the order of the elements in the web address: the GTIN first, then any key qualifiers (lot, serial) in their required path order, then the query-string attributes. Closient reads the HRI from the exact payload that is encoded in the symbol and never re-sorts it. That is why the line order in the generator is not something you can drag around.2. Brackets are in the text, never in the symbol
Application Identifiers (AIs) are shown in parentheses in HRI, as in(01) for a GTIN. The parentheses are a display convention only: “although parentheses are not encoded in the barcode, parentheses SHALL surround AIs in HRI” (4.14, general rule 2c).
Nothing in the QR code contains a bracket. A scanner never sees one. They exist so a person can tell where the AI stops and the data starts.
3. One element string, one line
An element string, meaning an AI and its data, “SHALL NOT be broken into multiple lines of HRI” (4.14, general rule 1e). A serial number appears on a single line, as in(21) ABCDEF12345. You can put different elements on different lines. You cannot split one in half.
4. Placement: adjacent, below by preference
HRI “SHOULD be placed adjacent to the barcode” and grouped together wherever physically possible, while keeping the text legible and leaving the symbol’s minimum height and quiet zones intact (rule 1a). When packaging forces it above or beside the barcode, it should still sit close enough that it is obviously associated with the symbol (rule 1b). Closient defaults to below the symbol. The generator disables placements that the symbol type does not permit. For a QR code carrying a Digital Link, those are below, above, and to the right.5. Font and size
A clearly legible font is required, and OCR-B is the example GS1 names. Avoid bold, italic, light and narrow versions. The text SHOULD be at least 2 mm (0.08 in) high, and at least 3 mm (0.1181 in) on a GS1 Logistics Label (rule 2a and rule 5c). Spaces are fine in the HRI itself and are never encoded in the barcode. The generator warns you when your size and font settings would print below the floor, instead of letting the error reach the press.Worked example: from Digital Link to HRI
Take a product with a GTIN, a lot, a serial number and a best before date. As a GS1 Digital Link URI:01 is the GTIN, 10 the lot, 21 the serial, 15 the best before date. The same data as a GS1 element string, which is how a GS1-128 or GS1 DataMatrix symbol would carry it, is:
- The lines are in URI order. The date is last because it is in the query string, after the path.
- The brackets appear only in the printed text. The URI has none.
- The element string uses brackets too, but only as a way of writing the data down. In a real GS1-128 or DataMatrix symbol the AIs are bare digits, and a separator character follows a variable-length value that is not last.
The GS1 General Specifications are the authority for HRI even when the payload is a Digital Link URI. The GS1 Digital Link URI syntax standard does not define its own HRI rules.
Placement and layout gallery
Every image below is rendered by the Closient code generator’s own composition code, from the same payload as the worked example. Only the option being shown changes. The symbol is a QR code with the same data in each one.Placement
Below (default)
Above
Right
Layout
Stacked
Single line
Two column
- Single line keeps everything grouped together, which is the spec’s stated preference, and it is the default. It works best when the symbol is wide enough to carry the text.
- Stacked puts one element on each line. It reads easily and suits a narrow symbol.
- Two column aligns data titles on the left with values on the right. It only makes sense with a notation that prints a title.
Bracketed notation and data titles
Bracketed AI (default)
Data title
Both
- Pick bracketed AI when you want the text to be the standard HRI. It is the default for that reason.
- Pick data title when the audience is a person who will never see a GS1 AI number. The text is easier to read, but GS1 classifies it as non-HRI, and for some uses such as healthcare, GS1 has its own rules about when titles may replace AIs (4.14.1).
- Pick both when you want the AI and the plain-language name together. It is the safest choice for a mixed audience.
2027-10-31 where the bracketed form prints the encoded 271031.
Point-of-sale codes need the 14-digit GTIN
If your code has to work at a checkout, GS1 asks for more than the general rules:- Barcodes for point of sale “SHALL have GTIN in HRI adjacent to the barcode” (4.14.2).
- GS1 DataBar Retail POS family, GS1 DataMatrix, Data Matrix (Digital Link) and QR Code (Digital Link) “SHALL display (01) followed by the encoded GTIN in a 14-digit format” (4.14.2). A 12-digit UPC-A or 13-digit EAN GTIN is shown padded with leading zeros to 14 digits, so the 13-digit EAN
9506000134352prints as(01)09506000134352. - The 14-digit HRI is not required for a 2D barcode that sits next to a linear barcode which has its own HRI, or for a 2D code meant for consumer engagement. When a 2D code is the only barcode carrying the GTIN, it must show the 14-digit form.