Home/ Blog/ Barcode Generator Guide

How to Generate a Barcode Online Free: EAN-13, UPC, CODE128 Explained

8901234567896
A correctly formatted barcode — right quiet-zone margin, right format for the job.

Table of Contents

  1. What Is a Barcode, Really?
  2. Barcode Formats Explained
  3. Which Format Should You Use?
  4. How Barcode Checksums Work
  5. What Kind of Scanner Reads These?
  6. Step-by-Step: Generating a Barcode Online
  7. Printing Barcodes That Actually Scan
  8. Common Mistakes to Avoid
  9. Do You Need a Real GS1 Number?
  10. Barcodes Beyond Retail Products
  11. Frequently Asked Questions

Every product on a store shelf, every courier parcel, and every library book you've ever borrowed has been tracked by a small pattern of black-and-white lines. Barcodes are one of the oldest pieces of everyday "technology" most people never think about — yet picking the wrong format, or generating one incorrectly, is a surprisingly common way small projects run into trouble. This guide walks through what barcodes actually encode, which format fits which job, and how to generate a clean, scannable one for free using EkZapp's Barcode Generator.

Whether you're a small business owner labeling your first batch of products, a warehouse manager trying to speed up manual stock counts, or a developer who just needs a quick CODE128 for a prototype, the underlying decisions are the same: pick the right format, get the data right, and print it so it actually scans. Get any one of those three wrong, and the barcode either fails at checkout or, worse, silently reads back the wrong information.

What Is a Barcode, Really?

A barcode is a visual encoding of data — usually a number, sometimes letters too — as a pattern of parallel bars of varying width. A scanner shines light across the pattern and reads the reflected pulses back as the original string of characters. It's a much older idea than QR codes: the first retail barcode scan happened on a pack of chewing gum in 1974, and the core system has barely changed since.

What has changed is how many different barcode "languages" now exist, each suited to a different job. That variety is exactly where most confusion starts — a courier tracking number and a supermarket price tag don't use the same format, and mixing them up is the single biggest reason a freshly generated barcode won't scan.

It helps to think of a barcode format the way you'd think of a file format: CODE128 is closer to a flexible, general-purpose format like CSV, while EAN-13 is closer to a rigid, standardized format like a bank account number — fixed length, fixed structure, and a built-in check to catch typos.

Barcode Formats Explained

Here are the formats you'll actually run into in practice:

Which Format Should You Use?

Your situationRecommended format
Selling a product through retail storesEAN-13 (or UPC-A in the US/Canada)
Internal stock tracking or SKU labelsCODE128
Shipping cartons or palletsITF-14
Courier tracking numbersCODE128
Asset tags, ID badges, older POS systemsCODE39
Very small product packagingEAN-8 or UPC-E

If you're not selling through a retail checkout system at all, there's rarely a reason to use EAN-13 or UPC-A — CODE128 is simpler, doesn't require registration with anyone, and can encode more information if you ever need it.

How Barcode Checksums Work

EAN-13, UPC-A, and ITF-14 all end in a checksum digit — a number mathematically derived from all the digits before it. When a scanner reads the barcode, it recalculates the checksum from the first digits and compares it to the last one; if they don't match, the scan is rejected rather than silently returning wrong data.

Worked example: EAN-13 checksum

Take the first 12 digits: 890123456789. Multiply alternating digits by 1 and 3 starting from the left, sum the results, and find how far that sum is from the next multiple of 10 — that gap is the checksum digit. For this example the calculated checksum is 6, giving the full code 8901234567896. A good barcode generator calculates this automatically, so you never have to do the arithmetic by hand.

This is also why a generator should reject a 13-digit EAN-13 input with an invalid checksum, or better, calculate the correct one for you from just the first 12 digits — which is exactly what EkZapp's tool does.

Worked example: UPC-A checksum

UPC-A follows the same idea with 11 digits plus a checksum. Take 03600029145: multiply the odd-position digits by 3, add the even-position digits as-is, sum everything, and the checksum is whatever brings that total to the next multiple of 10. Here that works out to 2, giving the full 12-digit code 036000291452. Get one digit wrong anywhere in the sequence and the checksum almost always changes too, which is exactly the point — it catches transcription errors before they reach a customer.

What Kind of Scanner Reads These?

Most barcode formats are readable by three broad categories of device, though not always equally well:

If you're building something for a warehouse or a checkout counter, it's worth testing with the actual scanner model that will be used in production rather than just a phone app — contrast, lighting, and print resolution requirements can vary meaningfully between devices.

Step-by-Step: Generating a Barcode Online

  1. Open the Barcode Generator — no signup required.
  2. Type the number or text you want encoded into the data field.
  3. Pick the format that matches your use case from the table above.
  4. Adjust bar width, height, margin, and color to fit the label size you're printing to — the preview updates live as you type.
  5. Download as PNG for quick digital use, or SVG if you're sending the file to a professional printer.
Everything renders locally in your browser using JavaScript — nothing you type is uploaded anywhere, so it works just as well for a one-off internal label as it does for a batch of product mockups.

Printing Barcodes That Actually Scan

A barcode that looks fine on screen can still fail to scan once printed. A few things matter more than they seem:

Keep the quiet zone

The blank margin on either side of the bars isn't wasted space — scanners use it to know where the code starts and ends. Cropping it too tight is one of the most common causes of a "no read."

Don't stretch unevenly

If you resize the image after export, scale width and height together. Stretching only horizontally or only vertically distorts the bar-width ratios the scanner depends on.

Print at real size

Use the SVG export for anything going to a professional printer — it stays crisp at any size, unlike a PNG that gets blurry when scaled up.

Test before a full print run

Scan a single printed copy with a phone barcode-scanning app before committing to hundreds of labels.

Common Mistakes to Avoid

Do You Need a Real GS1 Number?

If you're only using barcodes for internal tracking, event check-in, asset tags, or design mockups, no — any number works, and CODE128 is the simplest choice. But if you intend to sell a product through external retail stores or major e-commerce marketplaces, the product needs a barcode number properly issued through GS1, the global standards body that allocates company prefixes for EAN/UPC codes. A self-generated EAN-13 number that happens to have a valid checksum will still scan, but it isn't guaranteed to be unique — it could collide with another company's real registered product.

For businesses in India, barcode numbers are issued through GS1 India, the local affiliate of the same global system. Registration involves membership fees and documentation requirements that GS1 India updates from time to time, so check their official site directly for the current process, pricing, and how many barcodes your registration tier entitles you to — don't rely on a fixed figure from any third-party article, including this one. Many marketplaces that require a GTIN (Global Trade Item Number) — the umbrella term covering EAN-13, UPC-A, and similar codes — will specifically check that the prefix traces back to a real GS1 registration, so it's worth applying before listing products rather than after.

Until that registration comes through, this tool is still useful for mocking up exactly how the final packaging will look, testing your label printer's output quality, or generating placeholder codes for a staging environment — you simply swap in the real GTIN once it's issued.

Barcodes Beyond Retail Products

It's easy to associate barcodes only with supermarket checkouts, but they show up in far more everyday systems once you start looking. Libraries use CODE128 on membership cards and book spines to speed up checkout and returns. Hospitals use barcodes on patient wristbands and medication packaging as a safety check against giving the wrong drug to the wrong patient. Event organizers print CODE128 or CODE39 on tickets so a single handheld scanner can validate entry far faster than checking names against a list by hand. Courier and logistics companies rely almost entirely on CODE128 for the long alphanumeric tracking numbers printed on shipping labels, precisely because it isn't limited to digits the way EAN-13 or UPC-A are.

The common thread across all of these is the same one that applies to a small shop's own SKU system: you don't need a globally registered number to get real value from a barcode. You only need one when the code has to be understood correctly by a system outside your own control, like a retail partner's checkout software. For everything else — your own shelves, your own tickets, your own tracking numbers — any generator that produces a correctly formatted, scannable code is enough, and that's exactly the gap EkZapp's Barcode Generator is built to fill.

Published July 28, 2026 · Last updated July 28, 2026

Frequently Asked Questions

What is the easiest way to generate a barcode for free?

Use a browser-based barcode generator that renders the barcode locally with JavaScript. Type your data, pick a format like CODE128 or EAN-13, and download the result as PNG or SVG — no signup or software install needed.

Do I need a real GS1 number to make a product barcode?

For a barcode that scans correctly at real retail checkouts worldwide, yes — you need a GS1-issued company prefix. For prototyping, internal stock tracking, or non-retail use, any generator that lets you enter your own number works fine.

What's the difference between a barcode and a QR code?

A barcode is a 1D (linear) symbol that typically encodes a short numeric or alphanumeric string, read left to right. A QR code is 2D and can hold far more data, including URLs, in a square grid readable by a phone camera from any angle.

Can I resize a barcode without breaking it?

Yes, as long as you scale width and height proportionally and keep enough quiet-zone margin around the bars. Scanning a barcode that's been stretched unevenly, or has its margins cropped, often fails.

Which barcode format should a small shop use for its own products?

CODE128 is the most practical choice for an internal SKU system, since it can encode letters and numbers and doesn't require registering with GS1. Reserve EAN-13/UPC-A for products actually sold through external retail channels.

EH

Ekramul Hoque

Founder, EkZapp — building free utility tools for everyday tasks.

Generate a Barcode Now →