Barcode Generator
Generate barcodes in multiple formats (CODE128, EAN13, UPC, CODE39, and more). Create product barcodes, inventory codes, and identification labels. Download as SVG or PNG.
Enter the data you want to encode in the barcode. Format requirements vary by barcode type.
CODE128
Most versatile format, supports alphanumeric characters
Requirements: Alphanumeric characters
Example: ABC123
Width of individual bars (1-5)
Height of barcode (50-300)
Font size for displayed value (10-40)
Enter data above to generate a barcode
Table of Contents
What is a Barcode?
A barcode is a machine-readable representation of data in the form of parallel lines (or bars) of varying widths and spacing. Barcodes are scanned by optical devices called barcode readers or scanners, which decode the pattern to retrieve the encoded information.
Barcodes were first patented in 1952 and have since become essential in retail, inventory management, shipping, healthcare, and many other industries. They enable fast, accurate data entry and reduce human error.
Common uses include:
- Product identification — Retail products use EAN-13 or UPC barcodes
- Inventory management — Track items in warehouses and stores
- Shipping labels — Package tracking and logistics
- Library systems — Book and media identification
- Healthcare — Patient identification and medication tracking
- Event tickets — Admission and access control
Barcode Formats
Different barcode formats are designed for different purposes. Here are the formats supported by our generator:
CODE128 (Most Versatile)
The most versatile format, CODE128 supports alphanumeric characters and is widely used in shipping, packaging, and general identification. It has three variants:
- CODE128A: Uppercase letters, numbers, and control characters
- CODE128B: All printable ASCII characters (most common)
- CODE128C: Numeric only, most compact encoding
EAN-13 (Product Barcode)
The international standard for retail product identification. Used worldwide on consumer products. Requires 12 digits (check digit is auto-calculated).
Example: 123456789012 (becomes 13 digits with check digit)
EAN-8 (Short Product Barcode)
Used for small products where space is limited. Requires 7 digits (check digit is auto-calculated).
UPC-A (North American Product)
The standard barcode format in North America for retail products. Requires 11 digits (check digit is auto-calculated).
CODE39
An older but still widely used format. Supports alphanumeric characters and some special characters. Commonly used in non-retail applications like manufacturing and government.
ITF-14 (Shipping Container)
Used for shipping containers and cartons. Requires exactly 13 digits. Commonly used in logistics and warehousing.
MSI
Used in libraries and retail inventory systems. Numeric only format.
Pharmacode
Used in pharmaceutical packaging. Numeric only, designed for small packages.
Codabar
Used in libraries, blood banks, and shipping. Requires numbers with A-D as start/stop characters.
How it Works
Our barcode generator uses the JsBarcode library to create accurate, scannable barcodes:
- Input validation: Checks that your data matches the format requirements for the selected barcode type
- Encoding: Converts your data into the barcode pattern using the selected format's encoding rules
- Rendering: Generates an SVG image with bars of appropriate widths and spacing
- Display: Shows the barcode with optional text below showing the encoded value
The generator automatically:
- Calculates check digits for EAN-13, EAN-8, and UPC formats
- Validates input according to format requirements
- Generates high-quality SVG barcodes that scale without quality loss
- Provides download options in both SVG and PNG formats
Common Use Cases
- E-commerce: Generate product barcodes (EAN-13, UPC) for online stores
- Inventory Management: Create internal product codes using CODE128 or CODE39
- Shipping Labels: Generate tracking barcodes for packages
- Library Systems: Create barcodes for books and media using CODE39 or Codabar
- Event Management: Generate ticket barcodes for events and access control
- Healthcare: Create patient ID barcodes and medication tracking codes
- Manufacturing: Generate part numbers and serial numbers for products
- Retail: Create price tags and product labels
- Asset Tracking: Label equipment and assets with unique identifiers
Best Practices
Choose the Right Format
Select a format that matches your use case. For retail products, use EAN-13 or UPC. For internal inventory, CODE128 is versatile. For shipping, ITF-14 is standard.
Print Quality Matters
Barcodes must be printed clearly with high contrast (black bars on white background). Ensure adequate resolution — at least 300 DPI for printing. Avoid low-quality printers or blurry images.
Size Appropriately
Barcodes should be large enough to scan easily. For retail products, follow industry standards. For internal use, ensure the barcode is at least 1 inch wide and proportional height.
Test Before Production
Always test your barcodes with actual scanners before printing large quantities. Different scanners may have varying levels of tolerance.
Maintain Quiet Zones
Barcodes require "quiet zones" (empty space) on both sides. Our generator includes automatic margins, but ensure your design doesn't place text or graphics too close to the barcode.
Use Check Digits
For EAN-13, EAN-8, and UPC formats, the check digit is automatically calculated. Never manually enter the last digit — let the generator calculate it for accuracy.
Frequently Asked Questions
CODE128A supports uppercase letters, numbers, and control characters. CODE128B supports all printable ASCII characters (most versatile). CODE128C is numeric only and provides the most compact encoding for numbers. Choose based on your data type.
No! Enter only the required digits (12 for EAN-13, 7 for EAN-8, 11 for UPC). The calculator automatically calculates and adds the check digit. Including it manually will cause an error.
For retail products sold in North America, use UPC-A. For international retail, use EAN-13. These are the standard formats accepted by retailers and point-of-sale systems. You'll need to obtain official barcode numbers from GS1 for commercial use.
For internal use (inventory, tracking), yes. For retail products sold in stores, you typically need official barcode numbers from GS1 (the global standards organization). Our generator creates valid barcodes, but commercial retail use may require GS1 registration.
SVG is a vector format that scales without quality loss — perfect for printing at any size. PNG is a raster format with fixed resolution — good for digital use. For printing, SVG is recommended. For web use, PNG works well.
Common issues: low print quality, insufficient contrast, wrong format for your data, damaged barcode, or scanner incompatibility. Ensure high-quality printing (300+ DPI), black bars on white background, and test with multiple scanners. Also verify your data matches the format requirements.
While this tool generates standard black-on-white barcodes (which scan most reliably), you can edit the SVG file to change colors. However, maintain high contrast for reliability. Dark colors on light backgrounds work best. Avoid light colors that may not scan properly.
A quiet zone is the empty space required on both sides of a barcode. It helps scanners identify where the barcode starts and ends. Our generator includes automatic margins, but ensure your design doesn't place graphics or text in this area.