Barcode Generator

Generate Code 128, EAN-13, and UPC-A barcodes — download as PNG, entirely in your browser

Any printable ASCII text — letters, numbers, punctuation

2px
80px

About this tool

The Barcode Generator creates Code 128, EAN-13, and UPC-A barcodes directly in your browser — no server round-trip, and no external barcode library shipped to your browser either; the encoding logic is implemented from the published Code 128 and EAN/UPC specifications. Code 128 handles any printable ASCII text (letters, numbers, punctuation) via Subset B, while EAN-13 and UPC-A handle the numeric product codes used in retail, auto-computing and validating the check digit. During development, the encoder's output was verified byte-for-byte against a widely-used reference barcode library for a range of test inputs — matching not just visually, but at the level of individual black/white module widths — before being reimplemented independently for this tool. That verification step matters for a barcode specifically, since a single incorrect module makes the whole thing unscannable while still looking plausible to the eye. Adjust bar width and height, then download the result as a PNG ready to drop into a label, document, or product listing.

When to use it

  • Generating a Code 128 barcode for an internal inventory or asset-tracking label
  • Creating an EAN-13 barcode from a product's GTIN for packaging or an e-commerce listing
  • Producing a UPC-A barcode for a US retail product without a subscription barcode service
  • Quickly checking whether a 12 or 13-digit product code's check digit is actually valid

Tips

  • EAN-13 and UPC-A both accept the code with or without its check digit — leave it off and the tool computes the correct one automatically.
  • Code 128 (Subset B) covers printable ASCII, making it the right choice for anything that isn't a pure numeric product code — asset tags, internal SKUs, alphanumeric identifiers.
  • Increase bar width before printing at small sizes — thin bars are the most common reason a printed barcode fails to scan reliably.

Frequently asked questions

What's the difference between EAN-13 and UPC-A?

UPC-A is a 12-digit code used primarily in the US and Canada; EAN-13 is its 13-digit international superset. A UPC-A code is actually identical, bar-for-bar, to an EAN-13 code with a leading zero — any EAN-13 scanner can read a UPC-A barcode without special handling, which is why this tool implements UPC-A internally as exactly that case.

Why does Code 128 support text but EAN-13/UPC-A only support digits?

Code 128 is a general-purpose symbology designed to encode arbitrary text efficiently — it's what's used for things like shipping labels and internal tracking codes. EAN-13 and UPC-A are retail product-identification standards with a fixed, numeric structure (including a mandatory check digit) defined by GS1, so they're deliberately numeric-only by specification, not a limitation of this tool.

Can I use a barcode generated here for actual retail products?

The encoding is standards-compliant and verified against a reference implementation, but a real GTIN/UPC number for retail sale needs to be officially registered through GS1 (or a reseller) to be globally unique and legally usable on a product — this tool generates a correct barcode for whatever number you provide, but doesn't allocate or validate ownership of that number.

Related tools

🥷 ToolNinja