Barcode Number Generator – Create and Validate GTIN Test Numbers
Use the Barcode Number Generator above to create structurally valid EAN-13, UPC-A, EAN-8 and GTIN-14 numbers with correctly calculated check digits.
You can enter a GS1-issued company prefix when you are working with numbers assigned to your business, or generate restricted/internal-use test values when you only need data for software testing, fixtures or scanner workflows.
The distinction matters: a number can have a mathematically correct check digit and still not be assigned to your company.
For real retail products, obtain the appropriate GS1 identification capacity through GS1 and assign GTINs according to GS1 rules.
This tool calculates structure. It does not grant ownership of retail barcode numbers.
What Is a Barcode Number?
The visible digits under a retail barcode normally represent a standardized identifier.
For trade items, that identifier is commonly a GTIN—Global Trade Item Number.
GS1 defines several GTIN formats.
Common examples include:
- GTIN-12
- GTIN-13
- GTIN-14
GTIN-12 is commonly associated with UPC.
GTIN-13 is commonly associated with EAN.
GTIN-14 is commonly used for trade-item groupings and other packaging levels where appropriate.
The number identifies the trade item.
The barcode symbol is the machine-readable graphic that carries that number.
Those are related but separate concepts.
How to Use This Barcode Number Generator
Choose the required format.
Options include:
- UPC-A
- EAN-13
- EAN-8
- GTIN-14
If you have a GS1-issued company prefix, enter the correct prefix.
Then provide the starting item reference and quantity.
For GTIN-14, select the packaging indicator where appropriate.
Generate the numbers.
The tool calculates the final check digit automatically.
You can also paste an existing barcode number into the validation section to check whether its check digit is correct.
If you do not have assigned GS1 capacity, use generated values only for testing or internal workflows where the number is not being presented as a globally assigned retail product identifier.
GTIN-12 and UPC-A
GTIN-12 is a 12-digit GS1 identification key.
In North America, it is commonly encoded using the UPC-A barcode symbol.
A typical structure contains:
- company prefix/item reference allocation
- check digit
The exact division between company prefix and item reference depends on the prefix assigned to the organization.
Do not assume every UPC contains the same-length company prefix.
That is why manually slicing a GTIN based only on visual digit positions can be unreliable.
The complete GTIN is the identifier.
GS1 assignment records determine who owns the prefix and trade item.
GTIN-13 and EAN-13
GTIN-13 is commonly represented with the EAN-13 barcode symbol.
GS1’s own GTIN creation guidance describes the final digit as the check digit.
The earlier digits are used to construct the trade-item identifier according to GS1 assignment rules.
EAN-13 is widely used outside North America, although GTINs are global identifiers rather than "country-specific barcode numbers."
Do not infer product country of origin solely from the first digits of an EAN.
GS1 prefix allocation is about number administration, not necessarily where the product was manufactured.
GTIN-14
GTIN-14 is a 14-digit GTIN format.
It is commonly used to identify trade-item groupings or packaging configurations.
A GTIN-14 can include an indicator digit before the underlying item reference structure.
For example, different case configurations of a product may need distinct trade-item identifiers.
Do not assume the consumer unit and shipping case always use the same GTIN.
Packaging-level identification depends on how items are ordered, priced and traded.
GS1 provides rules for when a new GTIN is required.
The generator can produce structural GTIN-14 values, but business assignment remains your responsibility.
What Is the Check Digit?
The final digit of a GTIN is a check digit.
It is calculated from the preceding digits.
The purpose is error detection.
The GS1 algorithm applies alternating weights and calculates the digit required to make the weighted total align with the modulus rule.
You do not need to perform the arithmetic manually when using the generator.
The validator can also check an existing value.
A correct check digit proves only that the number is mathematically well formed.
It does not prove:
- GS1 ownership
- product assignment
- company identity
- authenticity
- marketplace acceptance
Those are separate questions.
How the GS1 Check Digit Works
At a high level, the GTIN check-digit calculation works from the rightmost data digit and applies alternating weights of 3 and 1.
The weighted values are summed.
The check digit is the amount needed to bring the total up to the next multiple of 10.
Example concept:
weighted sum: 67 next multiple of 10: 70 check digit: 3
GS1 provides an official check-digit calculator and manual calculation guidance.
Use the official algorithm rather than creating a custom checksum.
A marketplace may reject a GTIN immediately if the final digit does not validate.
A Valid Check Digit Does Not Mean a Valid Retail GTIN
This is the most important warning on the page.
Anyone can calculate a checksum.
That does not give them the right to assign a retail GTIN.
Suppose you generate 5012345678900 with a correct final digit.
The number may still belong to another company, be unassigned, or have a different product association.
For real retail use, obtain GTINs through GS1 and maintain product assignment records.
Use test-only generated numbers for:
- unit tests
- database fixtures
- scanner demos
- form validation
- QA
- barcode rendering tests
Do not list an invented test GTIN on a marketplace as though it were your assigned product identifier.
GS1 Company Prefix
A GS1 Company Prefix is licensed to an organization and forms part of GS1 identification keys.
The prefix length can vary.
A longer company prefix leaves fewer digits available for item references.
A shorter prefix provides more item-reference capacity.
This is why companies with large product catalogs may receive different prefix capacity than smaller businesses.
Do not guess your company prefix from a barcode.
Use the information provided by GS1.
The generator allows a prefix field because users with legitimate assigned capacity may need to create the corresponding item references and check digits.
Restricted Circulation Numbers
GS1 reserves certain prefix ranges for restricted-circulation purposes.
GS1 documentation identifies prefixes including 02 and 20–29 in restricted-circulation contexts.
These are useful for local, in-store or closed-system identification according to the relevant GS1 rules.
They are not globally unique retail identifiers for normal open supply-chain assignment.
That makes restricted ranges useful for certain test or internal scenarios, but do not assume every retailer or scanner will treat them as a universal product identity.
Know the scope of the number.
Internal Barcode Numbers vs Retail GTINs
A company can barcode internal data without assigning a retail GTIN.
For example, a warehouse may encode SKU-TSH-BLK-M in Code 128.
That is an internal barcode workflow.
A retail EAN-13 or UPC-A identifying a trade item in the open supply chain is different.
Use internal identifiers when:
- only your system needs the code
- the item is not sold through GTIN-requiring channels
- the barcode is for warehouse operations
Use an assigned GTIN when trading partners, marketplaces or retail systems require standardized global product identification.
Validate Existing Barcode Numbers
The validation feature is useful when:
- importing a supplier catalog
- debugging a marketplace rejection
- checking fixtures
- testing scanner software
- cleaning spreadsheet data
Paste the number.
If it has the full length, verify the check digit.
If it is missing the final digit, calculate the correct one.
A passing checksum does not prove ownership, so use GS1 verification services when you need to check company/product information associated with a GTIN.
Mathematical validation and assignment verification are separate steps.
Common Barcode Number Mistakes
Avoid these problems:
- assuming a correct checksum means the number belongs to you
- inventing a UPC for a real marketplace product
- treating SKU and GTIN as the same thing
- removing leading zeros
- assuming EAN prefix digits prove manufacturing country
- using a GTIN as a lot number
- generating a new GTIN for every production batch
- confusing barcode number and barcode image
- ignoring packaging-level identification
- using restricted-circulation numbers as globally assigned retail IDs
A barcode identifier has to be both structurally correct and assigned for the intended use.