QR codes and barcodes at scale

Printing one code is easy. Printing five thousand that all scan, on the right hardware, with the right payload, without paying twice for any of them, is the actual job.

A warehouse asks you for shelf labels. Marketing wants a QR code on every product insert. Finance wants asset tags for 3,000 laptops. Each request sounds like "call the generator in a loop", and each one goes wrong in a different way if that is all you do: the warehouse scanners cannot read QR, the insert codes point at a URL that will be dead in a year, and the asset tags get regenerated (and paid for) every time the script is rerun.

The Fundamentals project generated one signed QR code per event ticket. This lesson is about the decisions that come before the loop and the checks that come after it.

Pick the symbology before you write any code

The symbology is decided by who scans it and with what, not by what looks modern. Get this wrong and no amount of code fixes it, because the labels are already printed.

QR codeCode 128Code 39
Shape2D square1D linear1D linear
Read byPhone cameras, 2D imagersAny 1D laser or imagerAny 1D laser or imager, including very old ones
CharactersAny text, including UTF-8All 128 ASCII charactersUppercase A-Z, 0-9, space and - . $ / + %
Practical lengthHundreds of charactersRoughly 20-30 before the label gets too wideRoughly 10-15; it is the least dense
Typical homeMarketing, tickets, contact cards, Wi-FiShipping, inventory, asset tagsLegacy industrial and government systems

Three rules come out of that table.

Laser scanners cannot read QR codes. A handheld laser scanner sweeps one line across the label. A QR code has no meaningful single line. If the warehouse has laser guns, the answer is Code 128, however much you like QR.

Phones are bad at linear barcodes. Camera apps on most phones will open a URL from a QR code without any extra app, but treat a 1D barcode as text at best. If a consumer is meant to scan it, use QR.

Code 39 is for compatibility, never for preference. It exists because some older systems only understand Code 39. Its character set has no lowercase letters and no underscore. When we sent part_7781 with type: code39, the API refused it with "Invalid barcode data or type". When we sent part-7781 it succeeded, but Code 39 cannot represent lowercase, so whatever the scanner gives back will not be the lowercase string you stored. Normalise identifiers to uppercase before you generate Code 39, and store them that way.

One more boundary: the Barcode Generator produces code128 and code39 only. Retail product codes (EAN-13, UPC-A) require a number assigned by GS1 to your company, and the generator rejects ean13 as a type. The Barcode Reader, on the other hand, decodes EAN and UPC, which matters when you are receiving goods rather than labelling them.

Check yourself

A warehouse uses handheld laser scanners on its picking line. You need a label that encodes bin location IDs like A-12-07. Which symbology should you generate?

Answer the check above to continue.

Run every example on your own key. Free plan, no card.

Scaling up?

Volume pricing, custom SLAs, and dedicated support for high-traffic teams.

Contact sales