EAN-8 number generator — short barcode numbers for small packs

Generate 8-digit EAN-8 test numbers from the restricted-circulation range, or type the first seven digits of an EAN-8 to get its check digit, or all eight to check it.

Live demo · real result from this tool
Mode

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use the EAN-8 generator

  1. Pick the Mode: Generate test values or Validate or complete.
  2. When generating, keep the Prefix on 0 or 2: restricted circulation (safe for tests), or choose Any prefix. Set How many (up to 500) and press Generate.
  3. When checking, type into EAN-8 (or the first 7 digits to get the check digit).
  4. Seven digits return the Check digit and Full EAN-8; eight digits return Result with the digit given and expected.

What it does and when to use it

EAN-8 is the short form of the European Article Number. It carries 7 data digits and 1 check digit, which is enough for a small product range but nowhere near enough for every company, so GS1 hands EAN-8 numbers out sparingly.

The most common jobs for this page are testing a till or inventory app that has to accept both 8- and 13-digit codes, making labels for shelf or loose items in your own shop, and checking a number that has been read off a tiny pack. If your item has room for a normal barcode, use the EAN-13 generator; for North American shelves, the UPC-A generator. To draw the barcode itself, paste the number into the barcode generator and choose EAN-8.

How it works

EAN-8 uses the same GS1 mod-10 rule as the longer codes, but with seven data digits the weights start with 3:

  1. Multiply the 1st, 3rd, 5th and 7th digits by 3, and the 2nd, 4th and 6th by 1.
  2. Add everything up.
  3. The check digit brings the total up to the next multiple of 10.

Test numbers start with 0 or 2, followed by six random digits from crypto.getRandomValues, and then the check digit.

Worked examples

  • Completing a code. For 9638507: 9×3 + 6 + 3×3 + 8 + 5×3 + 0 + 7×3 = 86. Four more makes 90, so the tool returns Check digit: 4.
  • Checking it. The full code 96385074 gives Result: Valid.
  • Another one. 5512345 gives Full EAN-8: 55123457.
  • Test numbers. One run gave 04674238 and 03555729, both in the restricted range, with the standard test-values note.

Limits and tips

  • Leading zeros matter. Store EAN-8 numbers as text, not numbers, or a spreadsheet will drop the 0 and break the code.
  • The tool does not convert EAN-8 to EAN-13; they are separate number systems, not padded versions of each other.
  • A correct check digit only proves the digits are consistent, not that a product exists.

Frequently asked questions

When is EAN-8 used instead of EAN-13?
On packs too small for a full EAN-13 barcode, such as chewing gum, lipsticks, pencils or small cosmetics. An EAN-8 barcode is about 70% as wide. Shops also use EAN-8 numbers inside their own systems for loose items.
Why do generated numbers start with 0 or 2?
In the EAN-8 range, numbers starting 0 or 2 are kept by GS1 for restricted circulation, meaning a company's own internal use. They are not issued to brand owners, so a test number there does not clash with a real product. The Any prefix option can produce numbers that belong to someone.
Can I register my own EAN-8?
Real EAN-8 numbers are issued one by one by your national GS1 office, and only when a pack is genuinely too small for EAN-13. Generated numbers are test values, not registrations, and should not be printed on goods for sale.
What happens if I type 13 digits?
The tool expects 7 or 8. Any other length gets a message such as "An EAN-8 has 8 characters; this has 13." Use the EAN-13 generator for full-size codes.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close