Test barcode numbers

Numbers and symbols for testing a scanner, a point of sale, or a warehouse system. Correct ones for the happy path, and deliberately wrong ones for everything else, because a barcode test suite made only of valid codes tests almost nothing.

A valid code is half a test

If your fixtures are all correct, every test asserts the same thing: that the reader reads. What it cannot tell you is what happens when the check digit is wrong, when the symbology is not the one your parser expects, when the string is longer than the database column, or when a warehouse operator scans a carton code into a field built for an item code.

Those are the cases that break systems in production, and each of them needs a fixture that is wrong in one specific, known way. This generator will make them, because it tells you what is wrong rather than silently correcting it.

Fixtures worth having

What a correct system does with a bad code

Reject it and say which check failed. That sounds obvious and it is the behavior least often implemented: the common failures are accepting a bad check digit, and rejecting a good code with a message that names no reason. Both cost hours in a warehouse.

Worth testing separately: the difference between a code that cannot be read and a code that reads to invalid data. They arrive at your software through different paths and deserve different messages, and a system that reports both as an unreadable barcode sends somebody to clean a scanner lens that is fine.

Where these fixtures come from

Every symbology here is encoded from its own specification, and nineteen of the twenty-two are verified against zxing-cpp, an independent decoder, before release. So a code labeled valid on this site has been read back correctly by something that is not our own code, and a code you were told is invalid is invalid for the stated reason.

For QR specifically there is more: a testing toolkit that produces damaged symbols and degraded images with the expected outcome recorded for each one, including the cases that sit either side of what error correction can repair.

Questions

Can I get a barcode with an intentionally wrong check digit?

Yes. Type the full number with the digit you want and you are told what the correct value would be rather than being blocked. That is the fixture you need to prove your validation runs.

Are these real product numbers?

No, and they should not be. Retail numbers are issued by GS1 to a specific company, so invented numbers are correct for testing and wrong for a product that will cross a checkout. The arithmetic and the geometry are real either way, so a scanner behaves exactly as it would with a genuine code.

How do I generate a few hundred at once?

The bulk pages run the same encoders over a list, so the codes are identical to what the single generator produces. Sequential numbers with correct check digits are the usual starting point for a load or throughput test.

What about testing a scanner rather than my software?

Print at the size and on the material you will use in production, because that is where read rates actually differ. Take the SVG rather than scaling a PNG, and include a code at the smallest size you intend to deploy.

Open the barcode generator →

More barcode generators

Free barcode generator · EAN-13 barcode generator · UPC barcode generator · Code 128 barcode generator · Code 39 barcode generator · GS1-128 barcode generator · Barcode generator · QR code generator

Open the generator → · All formats