barcodegenerator.fyi Start
v1.0 · free forever

Generate retail barcodes,
instantly in your browser.

A free, no-signup tool for creating UPC-A, EAN-13, EAN-8, and UPC-E barcodes. Downloads as SVG or PNG with proper quiet zones and automatic check digit calculation.

§ 01 — generator

Pick a format,
enter your digits.

The check digit is calculated automatically. Hit randomize for a quick test code. Toggle the quiet zone for GS1-compliant exports — required if you're printing labels for retail.

UPC-A 12 digits · North America
EAN-13 13 digits · International
EAN-8 8 digits · Small packaging
UPC-E 8 digits · Compressed
Format
select one

11 digits required

UPC-A check: —
Include quiet zone
9-module margin · GS1 spec
§ 02 — primer

What is a barcode, anyway?

A barcode is a way of encoding numbers as a pattern of black bars and white spaces that a machine can read. The bars don't carry any meaning by themselves — they're just a printable alphabet for digits, the way Morse code is a printable alphabet for letters.

When a scanner runs across a barcode, it measures the widths of the bars and gaps and translates them back into the original digits. That sequence of digits is then looked up in a database — your store's inventory system, a national product registry — which is where the actual product information lives. The barcode itself doesn't know what's in the box. It just says 036000291452, and the database does the rest.

The format you'll see on most retail products in North America is UPC-A, a 12-digit code introduced in 1974 when a pack of Wrigley's gum became the first item ever scanned at a grocery checkout. The European equivalent, EAN-13, came along in 1977 and added a digit to accommodate country prefixes. Today these two standards (along with their compact siblings EAN-8 and UPC-E) sit on essentially every consumer product in the world.

§ 03 — anatomy

The pieces of a barcode

Every retail barcode you've ever scanned has the same four-part structure. Once you can name them, you can read a barcode the way a typesetter reads a column of text.

01 / Quiet zone

The white margins

Empty white space on either side of the bars. Looks like nothing, but scanners need it to find where the code starts and ends. GS1 requires nine modules wide on each side.

02 / Guard bars

The fence posts

Tall bars at the start, middle, and end. They're slightly longer than the data bars so scanners can find them quickly and use them as reference points for measuring the rest.

03 / Data digits

The actual code

Each digit becomes a unique seven-bar pattern. UPC-A and EAN-13 split these into a left and right half, with each half using a different encoding so the scanner knows which way is up.

04 / Check digit

The math

The last digit is calculated from the others using a simple weighted formula. If a scanner mis-reads a bar, the math doesn't work out, and the scan gets rejected. We compute this for you automatically.

§ 04 — formats

Which format do I use?

The four retail barcode standards all encode digits, but they differ in length, geographic use, and what kind of product they're meant for.

UPC-A
12 digits

The standard barcode on virtually every retail product sold in the United States and Canada. The first digit is a number system identifier (typically 0 for most products, 2 for variable-weight items like meat, 3 for pharmaceuticals). The next five digits identify the manufacturer, the following five identify the product, and the last is the check digit.

EAN-13
13 digits

The international standard, used in nearly every country except the US and Canada (which use UPC-A — though most modern scanners read both). EAN-13 starts with a 2 or 3 digit country prefix that tells you where the issuing GS1 organization is located. Books and magazines use a special version called Bookland EAN that encodes ISBN and ISSN numbers.

EAN-8
8 digits

A shorter international format for small products where a full EAN-13 won't physically fit — think a stick of gum, a small candy bar, or a single-serving sachet. EAN-8 codes are issued separately from EAN-13 codes and aren't a compression of them; they're their own number space, allocated only when a regular code can't be printed legibly.

UPC-E
8 digits printed

A clever compression of UPC-A. If a UPC-A code has lots of zeros in specific positions, it can be squeezed down to six visible digits (plus a leading zero or one and a check digit). The scanner expands it back to the full 12-digit form. Used on small US products where UPC-A would be too wide. Only number systems 0 and 1 can be encoded this way.

§ 05 — important

A note on real retail use.

This generator produces technically valid barcodes — the bars encode correctly, the check digits are right, and a scanner will happily read them. That makes them perfect for testing, mockups, prototypes, internal inventory systems, school projects, and anywhere you need a barcode that works but doesn't need to be globally unique.

For products you intend to sell at retail, however, you need a real GS1-issued company prefix. Major retailers (Amazon, Walmart, Target, every grocery chain) verify that the manufacturer prefix in your barcode is registered to your company in the GS1 global database. A randomly generated number might scan, but it won't pass that verification — and in the worst case it could collide with another company's real product.

→ If you're going to sell on a major marketplace, get a real prefix from gs1.org first. For everything else, this tool has you covered.

§ 06 — for makers

Who uses this thing?

Indie sellers

Etsy and small-batch makers who need barcodes for in-house inventory tracking, before scaling to GS1-registered codes.

Developers

Engineers building POS systems, inventory apps, or warehouse software who need realistic test data without seeding a database.

Designers

Packaging and print designers laying out product mockups who need a placeholder barcode that looks completely real on the comp.

Teachers

Computer science and math instructors covering encoding, error detection, and the mod-10 check digit algorithm with hands-on examples.

Internal ops

Warehouse, library, and asset management teams who need scannable codes for items that never leave the building.

Curious folks

People who saw a barcode, wondered how it worked, and are now reading the SVG output we generate to figure out the encoding.

§ 07 — questions

Frequently asked.

Is this really free? +
Yes. No signup, no rate limit, no watermark, no upgrade tier. The whole tool runs in your browser — barcodes are generated client-side and never sent to a server.
Will my barcode actually scan? +
Yes — the bar patterns and check digits are generated to spec. Any standard 1D scanner will read them. For best results, print at high resolution (use the Print or Ultra PNG setting), keep the quiet zone enabled, and don't shrink the printed barcode below about an inch wide.
Can I use these on Amazon or Walmart? +
Not for the official product listing. Major marketplaces require GS1-registered codes and verify them against a global database. You'd need to buy a company prefix from GS1 first. This tool is great for internal use, mockups, and prototyping.
SVG or PNG — which should I download? +
SVG if you're putting the barcode in a design tool, on a website, or anywhere it might get resized — it stays sharp at any size. PNG if you need a flat raster image for software that doesn't accept SVG (some label printers, older POS systems, Word documents). The Print resolution option produces a PNG sharp enough for physical labels.
What's the check digit for? +
It's a math-based safety net. The last digit of every retail barcode is calculated from the digits before it using a weighted sum. If a scanner mis-reads a bar — say it reads a 7 as a 1 — the check digit won't match the recalculated value, and the scan is rejected. Catches roughly 99% of single-digit errors.
Can I use this for QR codes or shipping labels? +
This generator focuses on the four retail 1D formats (UPC-A, EAN-13, EAN-8, UPC-E). For QR codes, head over to qrcodegenerator.fyi — sister site, same approach (free, no signup, client-side), supports URL/WiFi/vCard/email/SMS/phone/text with custom colors and logo embedding. Shipping labels typically use Code 128 or ITF-14, which is on our roadmap.
Why is the quiet zone important? +
A scanner finds the start and end of a barcode by looking for white space on either side. Without enough quiet zone, it can mistake nearby artwork or text for part of the bars. The GS1 spec calls for nine modules of clear space on each side. If you're printing for retail, leave it on; if you're embedding in a design where margin is already built in, you can turn it off.