Skip to content
faker.tools
All 79

Plate III · Financial, E-Commerce & Retail Stubs

Barcode & SKU Number Generator

UPC-A, EAN-13, EAN-8 and ISBN numbers with correct check digits, plus SKUs and ASIN-style codes.

#StandardCode
1EAN136879724726022
2EAN139037728843399
3EAN130248545103026
4EAN139419711800716
5EAN131787204718533
6EAN132629019325287
7EAN136375601205364
8EAN135460622843389
9EAN139089448324429
10EAN131023060889148
10 rows · 329 BGenerated in your browser · Barcode & SKU Number Generator

A test barcode number is a UPC, EAN or ISBN with a correct check digit that is not tied to a product you sell. This generator produces UPC-A, EAN-13, EAN-8, ISBN-13 and ISBN-10 numbers with the check digit computed, plus internal SKUs and ten-character ASIN-style codes — the identifiers a catalogue, POS system or inventory import has to validate.

How to use it

  1. Pick a standard. UPC-A and EAN-13 cover most retail; ISBN for books; EAN-8 for small packaging.
  2. Optionally enter a company prefix. Use 20–29 on EAN-13, or 2 or 4 on UPC-A, for numbers that can never identify a real trade item.
  3. Toggle ISBN hyphens and the separate check-digit column if your tests need them.
  4. Copy or export the batch. Feed it to a barcode renderer, or use the QR & barcode placeholder generator for images.

What you can control

  • UPC-A (12 digits), EAN-13 (13), EAN-8 (8), ISBN-13 (978 or 979 prefix) and ISBN-10, each with a correct check digit.
  • A company prefix of your choosing, including GS1 restricted-circulation ranges.
  • Hyphenated or compact ISBNs.
  • A separate check-digit column for testing validators digit by digit.
  • Internal SKUs (ABC-12345-67) and ASIN-style codes (B0 plus eight alphanumerics).

How the GTIN check digit works

Take the EAN-13 400638133393?. From the left, multiply the twelve digits alternately by 1 and 3 (equivalently, from the right by 3 and 1):

Digit 4 0 0 6 3 8 1 3 3 3 9 3
Weight 1 3 1 3 1 3 1 3 1 3 1 3
Product 4 0 0 18 3 24 1 9 3 9 9 9

The products total 89. The next multiple of ten is 90, so the check digit is 1: 4006381333931.

function gtinCheckDigit(body) {
  const sum = [...body].reverse().reduce((acc, d, i) => acc + Number(d) * (i % 2 === 0 ? 3 : 1), 0);
  return (10 - (sum % 10)) % 10;
}
gtinCheckDigit("400638133393"); // 1

Weighting from the right is what lets one function handle every GTIN length: the digit beside the check digit always gets weight 3.

Testing ideas

  • Leading zeros. UPCs and EANs can start with 0. Store one as an integer and it loses a digit and its check digit becomes wrong. Generate UPC-A codes with prefix 0 and round-trip them through your database.
  • UPC to EAN normalisation. Check that 036000291452 and 0036000291452 resolve to the same product.
  • ISBN-10 with X. Generate ISBN-10s until one ends in X, and confirm your field does not reject the letter or lowercase it.
  • Scanner input. Hardware scanners type the code and press Enter. Paste a code followed by a newline into your search field to simulate it.

What this is not

A correct check digit does not make a barcode yours. Retail barcodes must be licensed from GS1; ISBNs from your national ISBN agency. Use these for software testing, and use a restricted-circulation prefix whenever a number might end up printed.

Questions

Are these barcode numbers registered to real products?

Not intentionally. The check digits are correct, but the company prefix is random unless you supply one, so a generated EAN can coincide with a real GS1 allocation. To guarantee no collision, enter a restricted-circulation prefix such as 20–29 for EAN-13, or 2 or 4 for UPC-A.

Can I print these on products I sell?

No. Retail barcodes must come from a GS1 company prefix licensed to you. Generated numbers are for testing point-of-sale software, catalogues and inventory systems.

How is a GTIN check digit calculated?

Starting from the digit next to the check digit and moving left, multiply alternately by 3 and 1, add the products, and choose the check digit that brings the total to a multiple of 10. The same rule covers UPC-A, EAN-13, EAN-8 and ISBN-13.

Why does ISBN-10 sometimes end in X?

ISBN-10 uses a mod-11 check, so the check value can be 10. It is written as the Roman numeral X to keep the ISBN at ten characters.

What is the difference between UPC-A and EAN-13?

A UPC-A is a 12-digit code used mainly in North America. Prefix it with a zero and it becomes a valid EAN-13, which is why modern scanners and databases store both as 13- or 14-digit GTINs.

Next in Finance

All 11 →