QR Codes and Barcodes¶
Generate, customize, and download QR codes and barcodes for your trade items, lots, and serial numbers directly from GTIN1.
QR Code Generation¶
Every trade item, lot, and serial number in GTIN1 has a unique GS1 Digital Link URI. You can generate a QR code for any of these by navigating to the item in your organization dashboard and selecting Generate QR Code.
The QR code encodes the full Digital Link URI, which means anyone who scans it is taken directly to the hosted product page for that specific item, lot, or serial.
Supported Output Formats¶
| Format | Content Type | Best For |
|---|---|---|
| SVG | image/svg+xml |
Web use, infinite scaling, editing in design tools |
application/pdf |
Print-ready labels with product metadata | |
| EPS | application/postscript |
Professional prepress and packaging design |
PNG format is deprecated
PNG output is no longer supported. QR code requests with fmt=png silently fall back to SVG. Barcode requests with fmt=png return an error. Use SVG for raster conversion workflows - SVG files can be converted to PNG at any resolution using tools like Inkscape or ImageMagick.
Generating QR Codes via URL¶
You can generate a QR code for any Digital Link URI by appending query parameters to the URL. This works for both the organization dashboard endpoints and the public resolver.
Using the ?qr flag (returns SVG by default):
Using the ?fmt= parameter to specify format:
https://gtin1.com/01/00614524740870?fmt=svg
https://gtin1.com/01/00614524740870?fmt=pdf
https://gtin1.com/01/00614524740870?fmt=eps
QR Code Customization¶
You can customize the QR code appearance using query parameters:
| Parameter | Default | Description |
|---|---|---|
fmt |
svg |
Output format: svg, pdf, eps |
ecc |
Q |
Error correction level: L (7%), M (15%), Q (25%), H (30%) |
scale |
8 |
Module size in pixels |
border |
4 |
Quiet zone width in modules |
fill |
cmyk(0,0,0,1) |
Foreground color in CMYK notation |
bg |
transparent | Background color (white or omit for transparent) |
download |
false |
Set to 1 to trigger a file download |
filename |
auto | Custom filename for the download (without extension) |
Example - high error correction with white background:
Human Readable Interpretation (HRI) Text¶
SVG output includes GS1 Human Readable Interpretation text below the QR code, rendered in the OCR-B font family per GS1 specifications. This text displays the Application Identifier pairs encoded in the QR code:
- Trade item:
(01) 00614524740870 - Lot:
(01) 00614524740870 (10) LOT123 - Serial:
(01) 00614524740870 (21) SN456
HRI text is only included in SVG output. PDF and EPS formats embed this information differently within the document.
Uppercase Scheme and Host¶
GTIN1 uses uppercase scheme and host in Digital Link URIs encoded in QR codes:
This is intentional and follows GS1 best practices. QR codes use alphanumeric encoding mode for uppercase characters, which produces smaller (and therefore faster to scan) QR codes compared to mixed-case URLs. The resolver handles both cases identically.
PDF Label Output¶
When you request ?fmt=pdf for a QR code, GTIN1 generates a compact PDF label that includes:
- The QR code as a vector graphic
- A guard zone border for scanning reliability
- Product identification information
This is designed for individual label printing and packaging applications.
PDF Sheets for Bulk Printing¶
For printing multiple QR codes at once, use the PDF Sheet format. PDF sheets are formatted for standard 1" x 1" label stock (63 labels per sheet, arranged in a 7 x 9 grid on US Letter paper).
To generate a label sheet, navigate to the QR code builder for any item and select Label Sheet, or use the label sheet endpoint directly:
Label sheet options:
| Parameter | Default | Description |
|---|---|---|
include_info |
1 |
Set to 0 to fill all 63 positions with QR codes (otherwise position 1 shows an info panel) |
ecc |
Q |
Error correction level for the QR codes |
linkType |
none | GS1 linkType to include in the Digital Link |
The info panel (position 1, top-left) displays the GTIN, product name, lot or serial number, generation date, and a shortened Digital Link path for quick reference.
PDF Sheet with Both QR and Barcode¶
When generating a PDF sheet (?fmt=pdf_sheet), GTIN1 automatically includes both the QR code and a traditional 1D barcode on the same sheet. The barcode type is auto-detected based on the GTIN length.
Barcode (1D) Generation¶
GTIN1 generates traditional 1D barcodes for trade items. The barcode type is automatically selected based on the GTIN length, but you can override it manually.
Generating a Barcode¶
Navigate to any trade item in your organization dashboard and select Generate Barcode, or use the barcode endpoint:
Supported barcode formats:
| Format | Content Type | Description |
|---|---|---|
| SVG | image/svg+xml |
Scalable vector, ideal for web and print |
| EPS | application/postscript |
Professional prepress workflows |
Auto-Detection of Barcode Type¶
GTIN1 detects the appropriate barcode symbology based on GTIN length:
| GTIN Length | Default Symbology | Notes |
|---|---|---|
| 8 digits | EAN-8 | Short-form retail barcodes |
| 12 digits | UPC-A | North American retail standard |
| 13 digits | EAN-13 | International retail standard |
| 14 digits | ITF-14 | Outer case / logistics identifier |
Code 128 is always available as a fallback for any GTIN length.
Barcode Customization¶
| Parameter | Default | Description |
|---|---|---|
type |
auto |
Barcode symbology (auto, ean8, ean13, upca, itf14, code128, gs1_128, code39) |
fmt |
svg |
Output format: svg or eps |
module_width |
0.2 |
Bar width in mm |
module_height |
15.0 |
Bar height in mm |
font_size |
10 |
Human-readable text size |
text_distance |
5.0 |
Distance between bars and text |
quiet_zone |
6.5 |
Quiet zone width in mm |
write_text |
true |
Include human-readable digits below the barcode |
guardbar |
true |
Include guard bars (for EAN/UPC symbologies) |
Barcode Builder¶
The barcode builder page provides a visual preview of the barcode with all customization options. Access it at:
The builder lets you adjust dimensions, select symbology, toggle text and guard bars, and download the result in your preferred format.
Descriptive Filenames¶
When you download a QR code or barcode, GTIN1 generates a descriptive filename based on the item:
| Object Type | Filename Pattern | Example |
|---|---|---|
| Trade item | {gtin}-{name-slug} |
00614524740870-organic-apple-juice.svg |
| Lot | {gtin}-{name-slug}_LOT-{lot} |
00614524740870-organic-apple-juice_LOT-2026A.svg |
| Serial | {gtin}-{name-slug}_SN-{serial} |
00614524740870-organic-apple-juice_SN-001.svg |
You can override the filename using the filename query parameter.
Caching Strategy¶
GTIN1 uses a two-tier caching strategy to ensure fast delivery of QR codes and barcodes:
- Redis (L1 cache): Generated images are cached in Redis for 1 hour to deduplicate concurrent requests for the same QR code.
- CDN edge cache: Responses include
Cache-Control: public, max-age=31536000, immutableheaders, allowing Cloudflare to cache QR codes and barcodes at the edge for up to 1 year.
Since the content encoded in a QR code is determined entirely by the Digital Link URI and rendering parameters, the output is immutable. The same inputs always produce the same image, which makes aggressive caching safe and effective.
PDF sheets use a shorter CDN cache (1 hour) because they contain timestamps and mutable metadata like generation dates.
Adding Extra Application Identifiers¶
You can include additional GS1 Application Identifiers in the Digital Link encoded in a QR code. This is useful for embedding expiry dates, production GLNs, or other supply chain data directly in the QR code.
Using add query parameter:
Using ai. prefix parameters:
Both approaches produce the same result: a QR code encoding a Digital Link that includes the GTIN, expiry date (AI 17), and net weight (AI 3103).
GS1 LinkType¶
You can direct scanners to a specific resource by including the linkType parameter:
Common link types include gs1:pip (product information page), gs1:nutritionalInfo, gs1:safetyInfo, and gs1:recallStatus. See the GS1 Digital Link standard for the full list.