TL;DR: Most product barcodes aren't arbitrary numbers — EAN-13 and UPC-A end in a mathematically-derived check digit, and getting it wrong means a scanner rejects the label at the till or the warehouse. Pair this guide with Character Counter, Text Difference, Encoding Converter and Duplicate Finder.

Barcode Generator on CharCount creates print-ready codes for products, shelf labels and internal tracking. The standards behind them matter more than they look: GS1's barcode standards and the GTIN specification define exactly how a valid retail barcode is built, digit by digit.

Barcode Generator Online: How to Create Clean Codes for Products and Labels visual guide
A practical CharCount guide for cleaner, safer text workflows.

EAN-13 and UPC-A: not just 13 random digits

An EAN-13 barcode is a country/manufacturer prefix, a product code, and one final check digit computed from the other 12. UPC-A (common in the US and Canada) works the same way with 12 digits total. The check digit is what lets a scanner catch a misprint or a smudged bar instantly, instead of ringing up the wrong product.

The check digit formula: starting from the right, multiply alternating digits by 3 and 1, sum everything, and the check digit is whatever brings that sum up to the next multiple of 10. Change any other digit in the code and the check digit almost certainly stops matching — which is exactly the point: it's a built-in error detector, not decoration.

Why a barcode can look right and still fail to scan

A generator that only checks "is this 13 digits" will happily produce a barcode that looks correct but fails the check-digit test, and gets rejected by any GS1-compliant scanner at retail. The digits also have to be assigned correctly — a GTIN prefix isn't just any number, it's licensed to a specific company by GS1, so a barcode with the right check digit but the wrong prefix range can still be invalid for retail use, even though it scans.

Print quality causes the other common failure: bars need enough contrast and quiet space (blank margin) on each side, or the scanner's laser can't find the start/stop pattern at all — the code can be numerically perfect and still unreadable off a low-contrast or too-small printout.

Choosing a barcode format

  • Retail product for sale in stores → EAN-13 (international) or UPC-A (US/Canada), both check-digit validated.
  • Internal inventory or asset tracking, not sold at retail → Code 128 or Code 39, which allow letters as well as digits.
  • Small labels with limited print space → QR code, which packs more data into less linear space than a 1D barcode.

A pre-print checklist

Generate the code, then verify the check digit computes correctly for the exact number you intend to print — a single mistyped digit anywhere in the sequence changes it. Print a test label at final size and scan it with an actual barcode reader or a phone scanning app before running a full batch; a barcode that looks fine at 300% zoom on screen can still be too small or low-contrast in print.

Cross-check the source list with Duplicate Finder if you're generating many codes at once — two products sharing one GTIN by copy-paste error is a common and avoidable mistake — and use Character Counter to confirm each code is exactly the digit count the format requires before generating.