nutilz

Free Barcode Generator

Generate CODE128, EAN-13, UPC-A, EAN-8 and CODE39 barcodes. Customize colors and size. Download SVG or PNG instantly.

Encodes any ASCII text or numbers. No length limit.

#000000
#ffffff
Show text below barcode

Enter a value to generate a barcode.

Free Barcode Generator โ€” Generate Any Barcode Online

A barcode encodes data as a pattern of parallel bars and spaces that an optical scanner can read in milliseconds. Barcodes are used on virtually every physical product sold, shipped, or tracked โ€” from grocery store shelves to Amazon fulfillment centers to hospital medication carts. This free barcode generator supports the five most widely used 1D barcode formats: CODE128, EAN-13, UPC-A, EAN-8 and CODE39. All processing runs in your browser via the JsBarcode library โ€” nothing is uploaded to any server.

Barcode Formats Compared

Choosing the right barcode format depends on your industry, the data type you are encoding, and the physical constraints of your label.

FormatData TypeLengthPrimary Use
CODE128Any ASCIIVariableShipping, logistics, general labeling
EAN-13Numeric onlyFixed 13 digitsInternational retail products
UPC-ANumeric onlyFixed 12 digitsNorth American retail products
EAN-8Numeric onlyFixed 8 digitsSmall retail products (limited space)
CODE39Alphanumeric + symbolsVariableAutomotive, defense, government

CODE128 โ€” The Most Versatile Format

CODE128 is the most widely used linear barcode format in the world. It encodes the full ASCII character set โ€” any combination of letters, numbers, and symbols โ€” at high density. Unlike EAN and UPC formats, CODE128 has no fixed length requirement, making it suitable for anything from short SKUs like A1 to long serial numbers and order IDs.

CODE128 is used extensively in shipping (FedEx, UPS, USPS shipment labels), healthcare (medication lot numbers, patient wristbands), and internal inventory systems. GS1-128 โ€” a variant of CODE128 โ€” is the standard for encoding application identifiers in supply chain logistics. If you are not sure which format to use, start with CODE128.

EAN-13 and UPC-A โ€” Retail Product Barcodes

EAN-13 (European Article Number) and UPC-A (Universal Product Code) are the two dominant retail barcodes worldwide. Both encode a globally unique product identifier assigned by GS1, the international standards body that manages product identification.

UPC-A is 12 digits and was developed in North America. The first 6โ€“9 digits are a GS1 company prefix, followed by item reference digits and a check digit. Every product on a US grocery store shelf has a UPC-A barcode.

EAN-13 is a 13-digit superset of UPC-A used in the rest of the world. A UPC-A barcode can be read as EAN-13 by prepending a leading zero. Modern scanners (including smartphone apps) read both formats interchangeably. For international distribution, EAN-13 is preferred since it covers all markets.

Important: For commercial retail use, EAN-13 and UPC-A numbers must be obtained through a GS1 membership to guarantee global uniqueness. This generator will create valid barcodes from any numeric input โ€” but for retail distribution, the numbers themselves must be GS1-registered.

EAN-8 โ€” Compact Retail Barcodes

EAN-8 is a shortened version of EAN-13 designed for small product packages where a full 13-digit barcode would be too large. Common applications include chewing gum, pens, single-serve candy bars, and small cosmetic items. EAN-8 codes are assigned by GS1 national organizations for qualifying products that cannot accommodate an EAN-13 barcode.

CODE39 โ€” Legacy Industrial Barcodes

CODE39 (also known as Code 3 of 9) was one of the first barcodes to encode both letters and numbers, which drove its adoption in automotive manufacturing (VIN tracking), aerospace, defense, and government applications in the 1970s and 1980s. It is still required by some industries that standardized on it decades ago.

CODE39 encodes uppercase letters Aโ€“Z, digits 0โ€“9, and the special characters - . $ / + % and space. It is less dense than CODE128 โ€” a CODE39 barcode encoding the same data is about 25โ€“30% wider. Unless your industry specifically mandates CODE39 (military, some automotive suppliers), CODE128 is the better choice for new systems.

Check Digits Explained

EAN-13, EAN-8 and UPC-A all include a check digit as the last digit. The check digit is calculated from the preceding digits using a weighted modulo-10 algorithm (Luhn-like). When a scanner reads the barcode, it recalculates the check digit and compares it to the encoded value. A mismatch means the barcode was misread, triggering a rescan or error alert.

This tool accepts both 12-digit input (and auto-calculates the 13th check digit for EAN-13) and 13-digit input if you already know your check digit. For EAN-8, enter 7 digits. For UPC-A, enter 11 digits.

SVG vs PNG: Which Format to Download

Barcodes are inherently geometric โ€” they consist of precise rectangles at defined widths. SVG (Scalable Vector Graphics) is the ideal format because it stores the barcode as mathematical shapes rather than pixel data. An SVG barcode can be scaled to any print size โ€” 1 inch or 10 feet โ€” without quality loss or pixelation. Use SVG for:

  • Print-ready labels and packaging
  • Design files in Illustrator, Inkscape, or Figma
  • Embedding in HTML or React components
  • Any workflow where you need to resize later

PNG is a raster format โ€” it stores pixel data at a fixed resolution. This tool exports PNG at 2ร— the display resolution for sharpness on high-DPI screens. Use PNG for:

  • Inserting barcodes into Word documents or spreadsheets
  • Web pages that need a static image
  • Applications that do not accept SVG input
  • Quick prototyping and mockups

Quiet Zones: The Invisible Margin That Makes Barcodes Scan

Every barcode standard requires a quiet zone โ€” a blank margin on the left and right edges of the barcode. Scanners use this blank space to calibrate their reference for "dark" vs "light" before they begin reading the bar pattern. Without adequate quiet zones, even a technically perfect barcode can fail to scan.

GS1 specifies a minimum quiet zone of 10 modules (X-dimensions) for UPC and EAN barcodes. This generator adds a 12-pixel default margin. When placing barcodes in a design, ensure no other graphic elements โ€” borders, text, images โ€” intrude into the quiet zone.

Color Barcodes: Scanner Compatibility Warning

Standard laser barcode scanners detect contrast between dark bars and a light background. The scanner emits a red laser (630โ€“680nm wavelength) and measures reflectance โ€” dark bars absorb the laser, light spaces reflect it. This physics means:

  • Black bars on white background โ€” maximum compatibility, works on all scanner types
  • Dark colored bars on white background โ€” generally works on CCD and image-based scanners, may fail on laser scanners depending on color
  • White bars on dark background โ€” inverted barcodes are not reliably scannable on most hardware
  • Colored backgrounds โ€” yellow and other highly reflective colors cause scan failures on laser scanners

For any barcode that must be reliably scanned by hardware โ€” retail POS, warehousing, healthcare โ€” use black bars on a white background. Color customization is appropriate for decorative barcodes, mockups, prototypes, and digital-only applications where you control the scanning environment (e.g., smartphone camera scanning).

X-Dimension and Bar Width: Getting the Size Right for Print

The X-dimension is the width of the narrowest bar in a barcode. Everything else โ€” bar widths, space widths, quiet zones โ€” is expressed as a multiple of X. Larger X-dimensions produce wider, more scannable barcodes but consume more label space.

GS1 specifications for retail EAN/UPC barcodes target an X-dimension of 0.33mm (0.0130 inches) at 100% magnification, with an acceptable range of 80%โ€“200%. At 300 DPI print resolution:

  • Bar width 1 in this tool โ‰ˆ 0.085mm (very compact, suitable for small labels at high DPI)
  • Bar width 2 โ‰ˆ 0.17mm (good for screen display and 300 DPI print)
  • Bar width 3 โ‰ˆ 0.25mm (approaching GS1 retail minimum at 300 DPI)
  • Bar width 4 โ‰ˆ 0.34mm (meets GS1 X-dimension target at 300 DPI)

For critical retail applications, download SVG and scale to the exact size needed in your design software to control the physical X-dimension precisely.

Industry Use Cases by Format

E-commerce and fulfillment โ€” CODE128 on shipping labels (FedEx, UPS, USPS) encodes tracking numbers, service codes, and routing information. Amazon FBA uses CODE128 for FNSKU labels identifying seller inventory.

Retail โ€” EAN-13 and UPC-A on product packaging. GS1-128 on shipping cases carrying multiple EAN-13 products. EAN-8 on small items with limited packaging real estate.

Healthcare โ€” CODE128 and GS1-128 on medication packaging (lot number, expiry date, serial number encoded as GS1 Application Identifiers). Hospital wristbands and specimen labels use CODE128 for patient ID encoding.

Manufacturing and inventory โ€” CODE128 for asset tags, work order routing, and bin labels. CODE39 persists in automotive supplier labeling for legacy compatibility.

Libraries โ€” EAN-13 on book spine labels corresponds to the ISBN-13. CODE39 and CODE128 on library member cards and internal circulation systems.

Frequently Asked Questions

Can I use any number for an EAN-13 barcode? โ€” The generator will produce a valid barcode from any 12-digit number. However, for products you intend to sell at retail, the GS1 company prefix within the number must be legitimately assigned to your company. Otherwise the barcode may conflict with another company's product in retailer databases.

How do I create barcodes in bulk? โ€” This tool generates one barcode at a time for immediate download. For bulk generation (hundreds or thousands of barcodes), consider a backend script using JsBarcode in Node.js with the xmldom package for server-side SVG rendering.

What is GS1-128? โ€” GS1-128 is a subset of CODE128 that uses Application Identifiers (AIs) to encode structured data: lot number (AI 10), expiry date (AI 17), serial number (AI 21), etc. The data is human-readable in parentheses above the barcode: (01)12345678901234(17)261231. This tool generates standard CODE128 โ€” GS1-128 requires correct AI structure in the encoded string.

Is CODE128 the same as GS1-128? โ€” No. GS1-128 uses CODE128 encoding but requires specific formatting conventions defined by GS1. All GS1-128 barcodes are CODE128, but not all CODE128 barcodes are GS1-128.

Can QR codes replace barcodes? โ€” QR codes hold more data and can be read by smartphones without dedicated hardware. 1D barcodes scan faster on industrial hardware and integrate with legacy POS and warehouse systems. Both have their place โ€” QR for consumer-facing applications (menus, loyalty programs, landing pages), 1D barcodes for industrial supply chain and retail POS.

For generating QR codes, use the QR Code Generator. For custom image generation, Favicon Generator converts any image to multiple sizes. Browse all free design tools at Nutilz.