Generators
By ToolzBank Team•
2 min read
•Monday, August 25, 2025•Updated Friday, November 13, 2026

How Barcodes Work and How to Generate One for Your Product

Barcodes are everywhere on product packaging. Here is how they encode information, the different types available, and how to create one yourself.

How Barcodes Encode Information

A barcode stores data in a series of black bars and white spaces. A barcode scanner uses a laser or camera to read the pattern of bars and spaces and converts it back into numbers or text.

You can try everything below with ToolzBank's barcode generator. It's free and works right in your browser.

The width of each bar and space matters. Thicker bars represent different values than thinner bars. The specific pattern depends on the barcode format being used.

Common Barcode Types

UPC-A (Universal Product Code): 12 digits. Used on retail products in the US and Canada. Every grocery store product has one.

EAN-13 (European Article Number): 13 digits. The international version of UPC. Used worldwide for retail products.

Code 128: Can encode any ASCII character (letters, numbers, symbols). Used for shipping labels and internal tracking.

Code 39: An older format that encodes uppercase letters and numbers. Still used in some industrial applications.

ISBN: A specialized barcode for books. The ISBN-13 is based on EAN-13 format.

How to Generate a Barcode

Step 1: Choose the barcode type based on your use case.

  • Selling a product in stores? Use UPC-A or EAN-13.
  • Internal tracking or shipping? Use Code 128.

Step 2: Enter your product number or code. For UPC and EAN, this is usually a number assigned by a registering authority. For Code 128, you can use any text.

Step 3: Generate the barcode.** The tool creates the visual barcode image.

Step 4: Download and print it.**

Tips

  • Always test scan your barcode before printing it on packaging.
  • Make sure the barcode is large enough to scan — at least 1 inch (2.5 cm) wide when printed.
  • Use high contrast (black bars on white background) for the most reliable scanning.