Convert a UPC or EAN to a GS1 QR code step by step: validate the check digit, pad the GTIN to 14 digits, build a GS1 Digital Link URI and generate the QR Code.
Before you convert: confirm what the number is
The digits printed below a UPC-A symbol are a GTIN-12. An EAN-13 carries a GTIN-13, and EAN-8 carries a GTIN-8. These can all be represented in a 14-digit field by adding leading zeroes. The original check digit remains the last digit.
A converter can validate format and check-digit arithmetic, but it cannot prove that your organization licensed the number or assigned it to the correct product. Confirm ownership and product assignment in your master data or with your local GS1 Member Organisation.
The four conversion steps
- Normalize the input.Read the 8, 12, 13 or 14 digits and remove presentation spaces. Do not discard meaningful leading digits.
- Validate the check digit.Use the GS1 modulo-10 calculation. A failed check digit usually means a transcription error or a number that is not a GTIN.
- Express it as GTIN-14.Add filler zeroes on the left until the value has 14 digits. Do not recalculate the check digit simply because filler zeroes were added.
- Build and encode the URI.Use
https://your-domain.example/01/{gtin14}, then render that complete string in a QR Code suitable for the intended GS1 application.
Worked UPC-to-GS1-QR example
https://id.example.com/01/00012345678905This example uses an IANA-reserved documentation domain, so it is safe to show but is not a live product link. In a real deployment, use a domain and path operated for your product-identification service, or a GS1 service that your organization is entitled to use.
You may add optional data only when it exists and your process controls it. Lot (10) and serial (21) are key qualifiers in the path; expiry (17) is a query attribute:
https://id.example.com/01/00012345678905/10/LOT123?17=271231Choose a domain strategy deliberately
Brand-controlled domain
Best for long-term destination control. Your infrastructure must preserve the GS1 identifier path and provide reliable redirects or resolver behavior.
GS1 or partner service
Useful when provided by your GS1 organization or solution partner. Confirm entitlement, persistence, destination management and service terms.
No web domain
A GS1 element string can still be encoded in a GS1 QR Code or GS1 DataMatrix for scanner workflows, but it is not a Digital Link and will not behave like a normal website on a phone.
Common conversion mistakes
- Inventing a GTIN: a valid check digit does not make an unlicensed number legitimate.
- Using 12 or 13 digits in a new Digital Link: current GS1 syntax requires the 14-digit GTIN representation.
- Putting the GTIN directly after the domain: AI
01must identify what the number means. - Putting expiry in the path: AI
17is informative data and belongs in the query string. - Testing only on screen: production print quality, size, contrast, quiet zones and packaging shape affect scanning.
Authoritative references
- GS1 Digital Link Standard: URI Syntax—GTIN-14 representation and URI construction.
- GS1 2D Barcodes at Retail Point-of-Sale Implementation Guideline—data-carrier and deployment requirements.
- GS1 Barcode Syntax Resource—independent syntax checks and transformations.