Barcode Generator
Generate Code 128, EAN-13, UPC-A, and Code 39 barcodes. Download as PNG or SVG.
How to Use the Barcode Generator
- Choose a barcode format — select Code 128, EAN-13, UPC-A, or Code 39 using the chips at the top.
- Enter your data — type the text or number to encode. EAN-13 requires exactly 12-13 digits; UPC-A requires exactly 11-12 digits; Code 39 supports uppercase letters, digits, and some special characters.
- Click Generate — the barcode appears in the preview area.
- Download — click Download PNG for a raster image or Download SVG for a scalable vector file.
Barcode Formats Explained
Linear barcodes (1D barcodes) encode data as a sequence of bars and spaces of varying widths. Barcode readers (scanners) shine a light across the barcode and measure the reflectance pattern. Dark bars absorb light; white spaces reflect it. The pattern maps to characters according to the encoding standard used by that barcode format.
Code 128
Code 128 is the most versatile linear barcode. It can encode all 128 ASCII characters including uppercase and lowercase letters, digits, punctuation, and control characters. Code 128 uses three subsets: A (uppercase + control chars), B (full printable ASCII), and C (numeric pairs for compact digit encoding). This tool uses Code 128B, which handles all common text. Code 128 is the standard choice for shipping labels, inventory management, and any scenario where you need to encode arbitrary text in a compact barcode. It includes a mandatory check character that is automatically calculated.
EAN-13
EAN-13 (International Article Number, 13 digits) is the international standard for retail product barcodes. The first 2-3 digits identify the country or GS1 member organization. The next digits identify the company, and the remaining digits identify the product. The 13th digit is a check digit calculated from the first 12. EAN-13 encodes digits only and is read by every retail point-of-sale scanner worldwide. If you are selling products internationally, EAN-13 is the required format.
UPC-A
UPC-A (Universal Product Code) is a 12-digit barcode used primarily in the United States and Canada. The structure mirrors EAN-13: company prefix + product code + check digit. UPC-A is technically a subset of EAN-13 (an EAN-13 starting with 0 equals a UPC-A with the leading zero removed). Most modern scanners can read both formats interchangeably. For products sold only in North America, UPC-A is acceptable. For global products, use EAN-13.
Code 39
Code 39 (also known as 3-of-9) is one of the first barcode symbologies, developed in 1974. It encodes 43 characters: uppercase A-Z, digits 0-9, and special characters space, dash, dot, dollar, slash, plus, and percent. Each character is represented by 5 bars and 4 spaces, of which exactly 3 elements are wide (hence "3 of 9"). Code 39 does not require a check digit (though one can be added). It is still widely used in the automotive industry (AIAG standard), defense (DoD), and healthcare (HIBCC) for its simplicity and readability with inexpensive equipment.
PNG vs. SVG Download
PNG is a raster format — the barcode is rendered at a fixed pixel resolution. It works well for on-screen use, email attachments, and digital documents. For high-quality print, choose a resolution appropriate to your printer (300 DPI or higher). SVG is a vector format — the barcode is described as mathematical shapes (rectangles) that scale to any size without pixelation. SVG is the preferred format for product labels, print files, and any use case where the barcode will be resized after download. Both formats are generated entirely in your browser — no server upload required.