Generate Industry-Standard Barcodes from Any Data
Barcodes encode data as a pattern of parallel lines that optical scanners read at retail checkouts, warehouses, shipping labels, libraries, and laboratories. This tool generates four of the most widely used one-dimensional barcode formats — Code 128, Code 39, EAN-13, and UPC-A — directly in your browser. Enter your data, choose a format, and download a print-ready PNG.
Code 128: The Universal Format
Code 128 is the most versatile barcode symbology. It encodes all 128 ASCII characters — uppercase, lowercase, digits, punctuation, and control codes — in a compact format. It uses three code sets (A, B, C) and automatically switches between them for optimal density: code set C encodes digit pairs in a single symbol, making it very efficient for numeric data. Shipping labels (GS1-128), inventory systems, and general-purpose labeling all use Code 128.
EAN-13 and UPC-A: Retail Product Codes
EAN-13 is the international standard for retail product identification — the barcode on virtually every packaged product sold worldwide. It encodes exactly 13 digits including a check digit that the tool calculates automatically. UPC-A is the 12-digit variant used in the United States and Canada. Both are subsets of the same system: a UPC-A code is an EAN-13 with a leading zero. If you have a GS1-assigned product number, these are the formats you need.
Code 39: Simple and Self-Checking
Code 39 encodes uppercase letters (A–Z), digits (0–9), and seven special characters (- . $ / + % and space). It is used in US Department of Defense logistics (LOGMARS), automotive manufacturing, and healthcare because it is self-checking — each character is independently decodable without a checksum. The tradeoff is lower density: Code 39 barcodes are wider than Code 128 for the same data, so they need more label space.
Sizing for Reliable Scanning
A barcode must have a minimum bar width (the narrowest line) that a scanner's optics can resolve, and enough height for the laser to sweep across reliably. For print, a narrow bar of at least 0.26 mm and a height of at least 15 mm are recommended for Code 128. Retail barcodes (EAN/UPC) have their own sizing specification called the magnification factor, with 100% (nominal size) being 37.29 mm wide for EAN-13. Always include quiet zones — blank space on either side — of at least 10 narrow bar widths.
Browser-Side Generation
The barcode is drawn on an HTML canvas entirely in JavaScript. No data is sent to a server, which makes the tool safe for encoding internal product codes, serial numbers, patient IDs, and other sensitive identifiers. The generated PNG can be saved, printed, pasted into labels, or embedded in documents without any dependency on an external service.