barcode generator explained
Barcode Generator Explained: 1D Formats and SVG Output

What a Barcode Generator Actually Does

A barcode generator is software that converts a typed value — letters, digits, or both — into a machine-readable pattern of parallel bars and gaps that follows a published symbology standard. Each symbology (Code 128, EAN-13, UPC-A, Code 39, and others) defines how characters map to bar widths, how many characters fit in a given space, and whether a check digit is required. The generator's job is to apply that mapping and produce an image a scanner can decode. A browser-based generator like the Barcode Generator runs the entire mapping in JavaScript on your device, so the value you type never leaves your machine. The output is a vector SVG, which means the same file stays sharp whether you print it on a 4 mm jewelry tag or a full-page poster. Picking the right symbology and feeding it the right number of digits is the entire skill — the tool handles the rest of the encoding for you, including the modulo-10 check digits that retail scanners rely on to catch transcription errors before they reach a barcode label.

The Four 1D Formats Worth Knowing

1D (one-dimensional) barcodes encode data in the varying widths of parallel lines. The four formats supported by the Barcode Generator each cover a distinct use case, and choosing the wrong one is the single most common reason a generated barcode fails to scan at the register or in the warehouse.

SymbologyBest forCharacter setLengthCheck digit
Code 128Shipping, logistics, mixed text labelsFull ASCII (letters, digits, symbols)VariableBuilt-in (modulo-103)
EAN-13Retail products sold worldwideDigits only13 (12 data + 1 check)Modulo-10
UPC-ARetail products in the US and CanadaDigits only12 (11 data + 1 check)Modulo-10
Code 39Internal inventory, automotive, defense tagsA–Z, 0–9, a few symbolsVariableOptional (mod-43)

Code 128 is the workhorse of carriers and warehouses. It packs any ASCII character — letters, digits, and common symbols — into a compact, high-density pattern, which is why tracking labels and SSCC pallet codes default to it. EAN-13 is the 13-digit retail barcode scanned at checkout on most consumer products worldwide. UPC-A is its 12-digit North American sibling, used in the US and Canada. Code 39 (also called Code 3 of 9) is an older but rugged alphanumeric format that is still common in automotive, defense, and internal inventory systems because it needs no check digit and prints well on basic label stock. A retail scanner at a store checkout will be configured for EAN-13 or UPC-A; a logistics scanner at a carrier sort facility will usually be set up for Code 128; a factory-floor scanner may default to Code 39 — so picking the right symbology up front saves an entire wasted print run.

How Check Digits Catch Typos Before Printing

EAN-13 and UPC-A both end with a check digit — an extra digit computed from the others using a modulo-10 formula. When a scanner reads the code, it recomputes the check digit from the data digits and compares it to the printed one. If they do not match, the scanner rejects the read as a misread or a transcription typo. The same arithmetic is useful in reverse: a barcode generator that lets you type only the data digits and fill in the check digit for you is performing the same modulo-10 calculation. If you paste a full code, the tool should also verify the check digit is correct and flag the typo before you print a label that will never scan.

The check-digit formula for EAN-13, weighting from left to right by 1 and 3 alternately, is:

  1. Take the first 12 digits of the code.
  2. Multiply each by its weight — position 1 × 1, position 2 × 3, position 3 × 1, position 4 × 3, and so on through position 12.
  3. Sum the 12 products.
  4. The check digit is (10 − (sum mod 10)) mod 10.

Worked example for the published ISBN-13 9780306406157:

PositionDigitWeightProduct
19×19
27×321
38×18
40×30
53×13
60×30
76×16
84×312
90×10
106×318
111×11
125×315

Sum = 9 + 21 + 8 + 0 + 3 + 0 + 6 + 12 + 0 + 18 + 1 + 15 = 93. Then 93 mod 10 = 3, and the check digit is (10 − 3) mod 10 = 7. The full EAN-13 is therefore 9780306406157 — the same 13 digits printed on the back of most books. Code 128 and Code 39 do not require a separate user-supplied check digit. Code 128 carries its own modulo-103 integrity byte inside the pattern, and Code 39 has an optional mod-43 check character that most generators omit unless you explicitly request it. UPC-A uses the same modulo-10 arithmetic as EAN-13 but applied across 11 data digits instead of 12, which is why the Barcode Generator prompts for 11 (or 12) instead of 12 (or 13).

Why the Output Format Is SVG, Not PNG

A barcode is only scannable if its bar edges stay crisp. Raster formats like PNG store pixels, so when you scale a PNG barcode up to poster size the bars blur and a scanner can fail. SVG stores the barcode as vector geometry — lines drawn at exact widths — so the same file renders identically at 4 mm on a jewelry tag or 400 mm on a shipping placard. Every modern label application and browser opens SVG, and any design tool can convert it to PNG later if a particular workflow demands a raster. The flip side is that SVG is not a photograph: there is no anti-aliased gray, only exact widths of black bars and white gaps. That is the correct tradeoff for a barcode, because scanners read bar edges as binary transitions, not as continuous tone. Once the SVG is saved, you can drop it into a label template, packaging artwork, spreadsheet, or design file and scale it without re-rendering.

How to Generate a Barcode in Three Steps

  1. Choose a barcode format — Code 128 for logistics or any text, EAN-13 or UPC-A for retail products, Code 39 for inventory.
  2. Type your value; for EAN-13 enter 12 digits (or a full 13), and for UPC-A enter 11 digits (or a full 12) — the check digit is added or verified automatically.
  3. The barcode renders as you type. Click Download SVG to save a print-ready vector file.

That is the entire workflow for retail EAN-13 or UPC-A labels, logistics Code 128 shipping tags, and Code 39 inventory stickers. Once the SVG is on disk, drop it into a label template in Word, Pages, Illustrator, or your shipping software; resize freely; and print at any DPI. For a printable summary of formats, digit counts, and output options, the Barcode Generator cheat sheet gathers the same information into one place.

Why Local, Browser-Based Generation Keeps Your Data Private

Because the symbology mapping runs entirely in JavaScript on the page you loaded, the value you type never touches a server. SKUs, GTINs, internal tracking numbers, and pallet IDs stay on your machine — useful when a single label sheet includes codes you have not yet published and do not want indexed anywhere. The same local execution means the tool keeps working once the page is cached, so a flaky conference Wi-Fi connection does not block label printing on the show floor. There are no watermarks, no per-code fees, no account, and no usage cap; the entire pipeline from typed digits to saved SVG runs in one place, on the device in front of you, with no upload step in between.

If you're weighing options, Barcode Generator for Beginners: A Quick Start Guide covers this in detail.