Barcode Generator

Generate Code 128, EAN-13, UPC-A, and Code 39 barcodes. Download as PNG or SVG.

Enter text and click Generate to create a barcode.

How to Use the Barcode Generator

  1. Choose a barcode format — select Code 128, EAN-13, UPC-A, or Code 39 using the chips at the top.
  2. 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.
  3. Click Generate — the barcode appears in the preview area.
  4. 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.

Frequently Asked Questions

Code 128 is a high-density linear barcode symbology that can encode all 128 ASCII characters. It is widely used in logistics, shipping labels, and inventory management. Code 128B, used by this tool, supports uppercase and lowercase letters, digits, and common symbols.
UPC-A is a 12-digit barcode used primarily in North America for retail products. EAN-13 is a 13-digit barcode that is a superset of UPC-A, used worldwide. An EAN-13 code starting with 0 is equivalent to the UPC-A code with that leading zero removed. EAN-13 is the international standard.
A check digit is a calculated digit appended to barcode data to detect scanning errors. For EAN-13, the check digit is the 13th digit, calculated from the first 12 using a specific formula. For UPC-A, it is the 12th digit. This tool automatically calculates and validates check digits for EAN-13 and UPC-A.
Yes. Click the Download SVG button to get a vector SVG file. SVG barcodes scale to any size without pixelation, making them ideal for print, product packaging, and labels where quality at large sizes matters. For web and digital use, PNG is often sufficient.
Code 39 is one of the oldest barcode symbologies, capable of encoding uppercase letters A-Z, digits 0-9, and a small set of special characters. It uses a simple 5-bar, 4-space pattern per character. It is still used in automotive, defense, and healthcare industries due to its simplicity.