Complete Guide

Barcode Generator:
Create Barcodes Online Free

Learn how to use a free barcode generator to create Code 128, EAN-13, UPC-A, and Code 39 barcodes. Generate barcodes for retail, inventory, and commercial use — all from your browser.

Start Creating Barcodes

I have generated thousands of barcodes over the years — for product labels, inventory systems, event tickets, and warehouse shelves — and one thing I have learned is this: choosing the right barcode type matters more than most people realize.

Whether you are an e-commerce seller who needs EAN-13 barcodes for Amazon, a small business owner creating internal inventory codes, or a developer building a barcode generator online for your app, the process starts with understanding what each barcode format actually does. A Code 128 barcode can encode any alphanumeric text, making it the most versatile option for internal tracking. EAN-13 and UPC-A are retail standards — you see them on every product in a grocery store. Code 39 is the old reliable of industrial barcode systems, still used in defense and healthcare.

The good news? You do not need expensive software to generate barcode images. A free barcode generator like AFFLIGO lets you create barcodes directly in your browser — no downloads, no API calls, no data leaving your device. You type your data, pick a format, customize the look, and download a PNG or SVG file. It is that simple. In this guide, I will walk you through everything: how barcode encoding works, when to use each type, how to customize barcodes for your specific use case, and the best practices that separate professional barcodes from amateur ones.

What Is a Barcode Generator?

A barcode generator takes your data and converts it into a pattern of bars and spaces that machines can read.

At its core, a barcode is just a visual representation of data. The black bars and white spaces correspond to numbers and characters that a scanner decodes in milliseconds. A barcode generator online does the encoding work for you — you type in your product ID, SKU, or any text, and the tool produces a properly formatted barcode image ready for printing or digital use.

There are two main categories of barcodes. 1D barcodes (linear barcodes) use parallel lines of varying widths to encode data — Code 128, EAN-13, UPC-A, and Code 39 all fall into this category. 2D barcodes (like QR codes and Data Matrix) encode data in both horizontal and vertical dimensions, allowing them to store much more information. This guide focuses on 1D barcodes because they remain the standard for retail, logistics, and inventory management worldwide.

Pro Tip

When someone searches for "barcode generator online," they usually want something fast and free. AFFLIGO's barcode generator creates barcodes entirely in your browser using JavaScript — no server uploads, no API limits, completely private. The encoding algorithms run locally, so you can even use it offline after the page loads.

How Barcode Encoding Works

Understanding what happens behind the scenes helps you choose the right format and troubleshoot issues.

01

Data Input

You enter the data you want to encode — a product number, serial code, or text string. The barcode generator validates the input based on the type you selected. Code 128 accepts any alphanumeric text. EAN-13 requires exactly 13 digits (or 12 with auto-calculated check digit). Code 39 only accepts uppercase letters, digits, and a few special characters.

02

Encoding Algorithm

The generator converts each character into a specific pattern of modules (the smallest unit of a barcode). For Code 128, each character becomes an 11-module pattern of bars and spaces. For EAN-13, each digit is encoded as a 7-module pattern using left-side or right-side encoding tables. The algorithm also calculates a check digit — a mathematical checksum that scanners use to verify the barcode was read correctly.

03

Pattern Assembly

The encoded modules are assembled into a complete barcode pattern, including start characters, data characters, check digits, and stop characters. Quiet zones (blank margins on both sides) are added to ensure scanners can identify where the barcode begins and ends. The width of each bar and space is calculated based on your chosen bar width setting.

04

Image Rendering

The final pattern is rendered onto a canvas element or converted to SVG markup. Each module becomes a filled rectangle (bar) or empty space. The human-readable text is optionally drawn below the barcode. The result is a high-resolution image you can download as PNG for printing or SVG for scalable use in design software.

Barcode Types Compared

Each barcode type has specific use cases, character sets, and industry requirements. Here is how they stack up.

Feature Code 128 EAN-13 UPC-A Code 39
Character Set Full printable ASCII (A-Z, 0-9, symbols) Digits only (0-9) Digits only (0-9) A-Z, 0-9, -.$/+%
Data Capacity Letters, numbers, symbols (no limit) 12 + 1 check digit 11 + 1 check digit Up to 20 characters
Primary Use Internal tracking, logistics Retail (international) Retail (North America) Industrial, defense
GS1 Registered No (open standard) Yes (required) Yes (required) No (open standard)
Check Digit Modulo-103 Modulo-10 (auto-calculated) Modulo-10 (auto-calculated) None (optional)
Density High Medium Medium Low
Best For Shipping labels, inventory Products sold globally Products sold in US/Canada Asset tagging, ID badges

When to Use Each Barcode Type

Choosing the right barcode type depends on where and how it will be used.

Code 128 — The All-Rounder

Use Code 128 when you need to encode alphanumeric data like product names, serial numbers, or custom identifiers. It is the most common barcode in logistics and shipping. If you are not sure which type to pick, Code 128 is usually the safe choice for internal use. It encodes the full ASCII character set, making it far more versatile than numeric-only formats.

EAN-13 — International Retail Standard

If you are selling products in Europe, Asia, or anywhere outside North America, you need an EAN-13 barcode. Every product on a store shelf in these regions has one. You must purchase a GS1 company prefix to get legitimate EAN-13 numbers. The barcode generator will auto-calculate the 13th check digit if you enter 12 digits.

UPC-A — North America Retail

UPC-A is the standard for products sold in the United States and Canada. It is essentially a 12-digit subset of EAN-13 (a UPC-A barcode scans as EAN-13 with a leading zero). If you are selling on Amazon US, eBay, or in Walmart, you need a UPC-A barcode. Same GS1 licensing requirement applies.

Code 39 — Industrial Workhorse

Code 39 is the oldest and most widely used barcode in industrial settings. The US Department of Defense, healthcare (HIBC), and manufacturing all rely on it. It encodes uppercase letters, digits, and 7 special characters. The tradeoff is lower density — Code 39 barcodes are wider than Code 128 for the same data. Use it when your systems already expect Code 39.

Customizing Your Barcode

A barcode generator should give you control over how your barcode looks and scans.

Bar Height

Taller bars scan more reliably from greater distances. For product labels, 15-25mm is standard. For shipping labels that need to scan across a warehouse, go taller (30mm+). AFFLIGO's barcode generator lets you adjust bar height from 30px to 200px.

Bar Width

Wider bars are easier to scan but take more space. The "Medium" setting (2.5 modules) works for most use cases. Use "Thin" for compact labels and "Thick" for large-format printing or low-quality printers.

Quiet Zone

The quiet zone is the blank margin around the barcode. Scanners need this space to identify where the barcode starts and ends. The default 16px works for most situations. Increase it if your barcode is placed near other graphics or text.

Human-Readable Text

The text below the barcode shows the encoded data in plain sight. This helps humans verify the barcode matches the label. For retail barcodes, the text is required. For internal tracking, you might hide it for a cleaner look.

Barcodes for Retail Products

Selling products in stores or on Amazon? Here is what you need to know about retail barcodes.

If you want your product on a store shelf, you need a GS1-registered barcode. That means either EAN-13 (for international markets) or UPC-A (for North America). You cannot just make up numbers — every product needs a unique identifier assigned by GS1, the global standards body that manages barcode numbering.

Here is the process: first, register with GS1 to get a company prefix. This prefix ensures your barcodes are globally unique. Then, use a barcode generator to create the barcode image from your assigned number. The tool will auto-calculate the check digit (the 13th digit for EAN-13, the 12th for UPC-A). Finally, print the barcode on your product labels at the correct size — at least 38mm wide for UPC-A, 26mm for EAN-13.

Important

Do not use random numbers for retail barcodes. If two products share the same barcode, retailers will reject your listing, and scanners will misroute inventory. Always get your numbers from GS1. The barcode generator creates the image, but the numbers themselves must be legitimately assigned.

Bulk Barcode Generation

Need to create barcodes for an entire product catalog? Here is how to handle bulk barcode generation efficiently.

A web-based barcode generator like AFFLIGO creates one barcode at a time, which works fine for small batches. But when you need to generate barcode images for 50 or 500 products, you need a faster approach. The key is to separate the data from the rendering — prepare your numbers in a spreadsheet, then batch-convert them to barcode images.

01

Prepare Your Data in a Spreadsheet

Open Excel or Google Sheets and list all the numbers you need barcodes for. Column A: product name, Column B: barcode number. For EAN-13, enter 12 digits and let the tool calculate the check digit. For Code 128, you can use any text — SKU numbers, serial codes, or product names.

02

Use a Batch Processing Tool

For Code 128 barcodes, you can use a barcode font in Excel — install a free Code 128 font, apply it to your data column, and you have instant barcodes. For EAN-13 and UPC-A, use a Python script with the `python-barcode` library or a JavaScript library like JsBarcode to generate barcode PNGs from your spreadsheet data in seconds.

03

Verify and Print

Before printing your entire batch, scan a few barcodes with a phone app (like Scandit or any barcode scanner app) to verify they decode correctly. Check that the human-readable text matches the intended number. For retail barcodes, verify the check digit. Once confirmed, print at 300 DPI minimum for reliable scanning.

Pro Tip

If you need to create barcodes in bulk on a regular basis, consider using a barcode generator API or library in your own application. Libraries like JsBarcode (JavaScript), python-barcode (Python), or ZXing (Java) let you generate barcodes programmatically from spreadsheets, databases, or APIs — no manual clicking required.

Best Practices

Rules I follow on every barcode project to ensure reliable scanning and professional results.

Always Test Before Printing

Scan your generated barcode with at least two different scanners before printing a large batch. Phone camera scanners and handheld laser scanners have different sensitivity thresholds. A barcode that looks perfect on screen might not scan if the bars are too thin or the contrast is too low.

Maintain Proper Contrast

Barcodes need high contrast between bars and background. Black bars on white background is the gold standard. Avoid colored bars on dark backgrounds, light gray bars on white, or any low-contrast combination. If you must use colors, ensure the light-to-dark contrast ratio is at least 80%.

Respect Minimum Size Requirements

Every barcode type has a minimum print size. UPC-A must be at least 38mm (1.5 inches) wide. EAN-13 must be at least 26mm (1.02 inches) wide. Code 128 has no official minimum, but 25mm wide is a practical floor. Going smaller risks scan failures at retail point-of-sale systems.

Document Your Barcode Registry

Maintain a spreadsheet mapping every barcode number to its product, SKU, and assignment date. This prevents duplicates, simplifies reorders, and makes it easy to onboard new team members. I keep a master file with columns: barcode number, product name, format type, date assigned, and notes.

Frequently Asked Questions

The most common questions about using a barcode generator online.

A barcode generator is a tool that converts data like text, numbers, or product IDs into a machine-readable barcode image. You enter your data, choose a barcode type like Code 128 or EAN-13, and download the barcode as PNG or SVG. AFFLIGO's barcode generator does this entirely in your browser — no data leaves your device.

Yes. AFFLIGO's barcode generator online is completely free. You can create barcode images in Code 128, EAN-13, UPC-A, and Code 39 formats without signing up or paying anything. Download PNG or SVG files with no watermarks or restrictions.

Code 128 is a versatile alphanumeric barcode that can encode any text between ASCII 0-127. EAN-13 is a numeric-only barcode used exclusively for retail products. Code 128 is better for internal inventory, while EAN-13 is required for products sold in stores worldwide.

AFFLIGO's barcode generator creates one barcode at a time. For bulk barcode generation of 100+ items, use spreadsheet-based tools like Excel with barcode fonts, or programming libraries like JsBarcode and python-barcode. These tools can generate barcode images from spreadsheet data automatically.

Use PNG for web, printing, and general use. Use SVG if you need the barcode to scale to any size without losing quality — ideal for professional design work, large-format printing, or further editing in vector software like Illustrator or Inkscape.

No. Everything runs in your browser using JavaScript. No data is sent to any server. The barcode encoding algorithms are implemented directly in JavaScript, and the barcode is rendered onto an HTML5 Canvas element. You can use this tool completely offline after the page loads.

Quick Reference Card

Bookmark this section for instant access to barcode type selection and print requirements.

Which Type Should I Use?

  • Retail (global): EAN-13
  • Retail (US/Canada): UPC-A
  • Internal tracking: Code 128
  • Industrial/defense: Code 39
  • Shipping labels: Code 128
  • Asset tagging: Code 128 or Code 39

Print Requirements

  • EAN-13 min width: 26mm (1.02")
  • UPC-A min width: 38mm (1.5")
  • Code 128 min width: 25mm (1")
  • Resolution: 300 DPI minimum
  • Contrast: 80%+ light-to-dark
  • Quiet zone: 10x module width

Character Limits

  • Code 128: Any length (limited by canvas width)
  • EAN-13: 12 digits + check
  • UPC-A: 11 digits + check
  • Code 39: Up to 20 chars
  • Code 39 charset: A-Z 0-9 -. $/+%
  • Check digit: Auto-calculated

GS1 Licensing

  • Required for: EAN-13, UPC-A
  • Not required for: Code 128, Code 39
  • Where to get: gs1.org
  • Cost: Varies by company size
  • Renewal: Annual fee
  • Alternative: Internal codes only

Ready to Create Your Barcode?

Use our free barcode generator to create Code 128, EAN-13, UPC-A, and Code 39 barcodes instantly. Download PNG or SVG — no signup, no watermarks, 100% private.

Generate Barcode Free