Barcode Generator

Generate CODE128, EAN-13, and UPC-A barcodes instantly. Customize dimensions and download as PNG.

About Barcode Types

Barcodes encode data in visual patterns that scanners can read. Different barcode standards serve different use cases, from retail products to shipping labels.

CODE128

CODE128 is a high-density linear barcode that supports all 128 ASCII characters. It uses three subsets (A, B, C). This tool uses subset B which supports standard printable ASCII (space through DEL). CODE128 includes a modulo-103 checksum for data integrity.

EAN-13

The European Article Number (EAN-13) is the standard barcode for retail products worldwide. It encodes 13 digits: the first 12 are data and the last is a checksum calculated using a weighted modulo-10 algorithm.

UPC-A

UPC-A is the 12-digit barcode standard used primarily in North America for retail products. It is a subset of EAN-13 and uses the same checksum algorithm with different weight positioning.

How Checksums Work

Barcodes include checksum digits to detect scanning errors. CODE128 uses modulo-103, while EAN-13 and UPC-A use a weighted modulo-10 algorithm. The generator calculates these automatically.

How to Use the Barcode Generator

  1. Select the barcode type: CODE128 for general-purpose alphanumeric data, EAN-13 for 13-digit international product barcodes used in retail, or UPC-A for 12-digit North American product barcodes.
  2. Enter the data to encode. For CODE128, type any text or numbers. For EAN-13, enter exactly 12 digits (the 13th check digit is calculated automatically). For UPC-A, enter exactly 11 digits (the check digit is appended automatically).
  3. Adjust the bar width and bar height settings to control the physical dimensions of the generated barcode. Narrower bars produce more compact barcodes; taller bars are easier for laser scanners to read.
  4. Click Generate to render the barcode, then Download PNG to save it as a high-resolution image file suitable for printing on product packaging, labels, or inventory tags.

Understanding Barcode Types and Standards

Barcodes are machine-readable optical labels that encode data in the widths and spacings of parallel lines. The three formats supported by this generator cover the most common use cases. CODE128 is a high-density linear barcode that can encode all 128 ASCII characters (numbers, letters, and symbols). It is widely used in shipping, packaging, and logistics because of its flexibility and compact size. CODE128 automatically switches between three sub-code sets (A, B, C) to optimize encoding density — numeric data uses Code Set C which encodes two digits per bar pattern, doubling density compared to single-character encoding.

EAN-13 (European Article Number) is the global standard for retail product barcodes, used on virtually every consumer product sold outside North America. It encodes exactly 13 digits: a 2-3 digit country/GS1 prefix, a 4-5 digit manufacturer code, a 5-digit product code, and a single check digit computed using a modulo-10 algorithm. The check digit provides error detection, ensuring scanners reject misreads. UPC-A (Universal Product Code) is the 12-digit North American equivalent of EAN-13, structurally identical but shorter. UPC codes can be converted to EAN-13 by prepending a leading zero. Both formats use the same bar-and-space encoding patterns and are scannable by the same hardware.

When generating barcodes for printing, several technical considerations affect scannability. The quiet zone — the blank margin on both sides of the barcode — must be at least 10x the narrowest bar width to allow scanners to identify the start and end of the code. The minimum recommended bar width for reliable scanning is typically 0.19mm (7.5 mil), though many scanners can read narrower bars. Bar height matters too: shorter barcodes are harder to scan at angles, so retail EAN/UPC barcodes should be at least 25mm tall. Always test printed barcodes with an actual scanner before mass production, as printer resolution, ink spread, and label material can all affect readability.

Frequently Asked Questions

What barcode types are supported?
CODE128 (subset B for ASCII text), EAN-13 (13-digit retail), and UPC-A (12-digit North American retail).
Is the barcode generation done client-side?
Yes, all encoding and rendering happens in your browser. No data is sent to any server.
Can I use these barcodes commercially?
Yes, all generated barcodes are free for personal and commercial use with no restrictions.
How do I scan the generated barcode?
Use any barcode scanner app on your phone or a dedicated barcode scanner. Print at sufficient resolution for reliable scanning.
What is the difference between CODE128, EAN-13, and UPC-A?
CODE128 encodes any alphanumeric data and is used for shipping and logistics. EAN-13 encodes 13 digits for international retail products. UPC-A encodes 12 digits for North American retail products. EAN-13 and UPC-A are structurally similar but differ in length.
How is the check digit calculated for EAN-13 and UPC-A?
The check digit uses a modulo-10 algorithm: multiply alternating digits by 1 and 3, sum the results, and find the smallest number that makes the total a multiple of 10. This generator calculates it automatically from your 11 or 12 input digits.
What resolution should I use when printing barcodes?
Print at 300 DPI or higher. The minimum bar width for reliable scanning is about 0.19mm (7.5 mil). Always include quiet zones (blank margins) of at least 10x the narrowest bar width on both sides. Test with a real scanner before mass printing.
Can I use these barcodes commercially?
Yes. CODE128, EAN-13, and UPC-A are open standards. However, for retail products, you must obtain a legitimate GS1 company prefix to ensure your product codes are globally unique. Contact GS1 (gs1.org) to purchase a manufacturer prefix.

Related Tools