Barcode Generator

Generate EAN-13, Code 128 and UPC-A barcode payloads.

Open tool

Overview

The Barcode Generator produces machine-readable barcode payloads for the three most common retail and logistics symbologies: EAN-13, Code 128 and UPC-A. Instead of installing a desktop label suite, you can type or paste a product code, pick the symbology, and copy a ready-to-render payload that downstream printer drivers, label templates or POS systems will accept.

This generator is aimed at small e-commerce sellers preparing inventory, warehouse staff rotating SKU labels and developers seeding test catalogues. Useful long-tail searches like "free EAN-13 barcode payload generator", "UPC-A check digit calculator" and "Code 128 string builder for labels" all map to this tool.

How it works

EAN-13 and UPC-A are fixed-length numeric symbologies governed by GS1 standards. EAN-13 carries twelve data digits plus a modulo-10 check digit; the check digit is computed by multiplying alternating digits by weights of 1 and 3, summing, and subtracting from the next multiple of ten. UPC-A uses the same checksum but with twelve total digits. The tool validates the supplied digits, computes any missing check digit and rejects payloads that fall outside the legal range.

Code 128 is an alphanumeric symbology that supports the full ASCII set across three subsets (A, B and C). The generator chooses an efficient subset combination, inserts the required start code, computes the modulo-103 checksum from weighted character values, and emits the encoded payload ready for a font, SVG renderer or printer driver.

Examples

EAN-13 input: 590123412345  → 5901234123457
UPC-A input: 03600029145  → 036000291452
Code 128 input: HELLO-2026  → [Start B] HELLO-2026 [Check] [Stop]
EAN-13 GS1 country prefix 978 (book ISBN): 9781234567890 → 9781234567897

FAQ

Does the generator print the barcode?

The tool returns the validated payload string and checksum. Pair it with a barcode font, a label template or your printer's SDK to produce the printable image.

What if my input already has a check digit?

The tool detects this and verifies the digit. If the supplied check digit is wrong it reports the expected value rather than silently overwriting your input.

Why does Code 128 sometimes pick subset C?

Subset C encodes pairs of digits in a single symbol, so long numeric strings shrink dramatically. The generator switches into and out of subset C automatically whenever it produces a shorter barcode.

Can I use these for real retail products?

Real EAN/UPC numbers must come from a GS1-assigned company prefix. The generator validates the structure and checksum, but it does not assign a registered prefix on your behalf.

Are the payloads safe to commit to source control?

Yes. The payloads are deterministic from your input and contain no secrets, so they are fine to store alongside test fixtures and label templates.

Try Barcode Generator

An unhandled error has occurred. Reload ×