Toolvito

Works on this device

Product Code Generator

Make codes for your products. Work out the check digit of a UPC or EAN number, number your products under the GS1 company prefix of your business, or make your own codes for use inside your shop. Everything is made in this browser.

Enter your values

The last digit of a UPC or EAN number is a check digit. Work it out for the digits before it, or check numbers you already have.

Your values

Spaces and hyphens are left out. Up to 1,000 numbers.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose the button below them.

How to use this generator

  1. Choose what you want to make: a UPC or EAN check digit, numbers under your own GS1 company prefix, your own numbered codes, or your own random codes.
  2. Type the numbers or choose the settings. Numbers can be typed one on each line, with or without spaces.
  3. Choose Generate. Copy the list, download it as a text file, or download the table as a CSV file for a spreadsheet.

UPC and EAN numbers

A UPC-A number has 12 digits and an EAN-13 number has 13. Both are GTINs (Global Trade Item Numbers). The number is made of the company prefix that GS1 licenses to a business, an item reference that the business gives each product, and a check digit at the end.

Check digit: from the right, the digits before the check digit are multiplied by 3, 1, 3, 1 and so on. The products are added, and the check digit is the number from 0 to 9 that makes the sum a multiple of 10.

This page does not give out UPC or EAN numbers. A number is valid for goods sold in shops only when its company prefix is licensed to your business by GS1. A correct check digit alone does not make a number registered. To draw the bars, use the Barcode Generator.

Your own product codes

  • Numbered codes: text before the number, a number with leading zeros (00001) and, if you want, a check character. Numbered codes never repeat.
  • Check characters: Luhn mod 10, GS1 mod 10, ISO 7064 MOD 11-2 (a digit or X) or ISO 7064 MOD 97-10 (two digits). Each is worked out from the digits of the number part and finds most typing mistakes.
  • Random codes: letters and digits chosen at random, so a code does not show how many products you have. The list comes from a seed that is shown, so you can make the same list again. A code that is already in the list is drawn again.
  • The chance that two random codes from separate lists are the same is about 1 − exp(−n(n − 1) ÷ (2N)) for n codes out of N possible ones.

Worked example

For the UPC-A digits 03600029145, the weights from the right give 5×3 + 4×1 + 1×3 + 9×1 + 2×3 + 0×1 + 0×3 + 0×1 + 6×3 + 3×1 + 0×3 = 58. The next multiple of 10 is 60, so the check digit is 2 and the full number is 036000291452.

Numbered codes with the text PRD- and 5 digits run PRD-00001, PRD-00002 and so on. With a Luhn check digit, 7992739871 becomes 79927398713.

Random codes of 8 characters from 30 letters and digits give 30⁸, about 656 billion, different codes. Among 10,000 such codes the chance of a repeat is about 0.0076%.

Limits you should know

  • The page cannot check that a company prefix belongs to you, or which codes are already in use in your shop. Keep one list and do not give a code twice.
  • UPC-E (the short 8-digit form) and add-on codes are not covered.
  • Random codes come from a seed, so they are not secret. Do not use them as passwords, vouchers or keys.
  • Software product keys are made by the maker of the software. This page does not make them.
  • Up to 1,000 codes at a time.

Related tools