Developer Tools

Barcode Generator

This tool draws standard retail and logistics barcodes in your browser. Each symbology has its own rules about what it can encode and how long the input must be, and most have a check digit computed from the other digits — get that wrong and the barcode scans as a different product entirely. Those rules are enforced here rather than left for a scanner to discover.

Runs entirely in your browser — nothing you paste is uploaded.

Format

Retail products outside North America.

Accepts: 12 digits (the 13th is calculated) or 13 to verify

Check digit 7 will be appended, making 5901234123457.

80px

How to

How to use the Barcode Generator

  1. 1

    Choose a symbology

    EAN-13 for retail products outside North America, UPC-A within it, and Code 128 for internal or logistics use where you need letters as well as digits.

  2. 2

    Enter your data

    The required length and allowed characters are shown for the format you picked, and the input is checked as you type.

  3. 3

    Let the check digit be calculated

    For EAN and UPC the final digit is derived from the others. Enter the shorter number and it is computed, or enter the full code and it is verified.

  4. 4

    Download

    SVG for print, since a barcode must be crisp to scan. PNG for screens and documents.

Examples

Barcode Generator examples

An EAN-13 check digit

Input
590123412345
Output
5901234123457

The thirteenth digit is derived from the first twelve by a weighted sum. A wrong check digit means scanners either reject the code or read a different product.

Code 128 with letters

Input
ABC-12345
Output
A Code 128 barcode

Code 128 encodes the full ASCII set and has no fixed length, which is why it is the usual choice for internal part numbers and shipping labels.

A length that will not encode

Input
12345 as EAN-13
Output
Error: EAN-13 needs 12 or 13 digits

Fixed-length symbologies cannot encode arbitrary input. Reporting this immediately is better than producing an image that no scanner will read.

Why use it

What the Barcode Generator gives you

Check digits handled correctly

The digit is calculated from your data or verified against it, which removes the most common cause of a barcode that scans as the wrong product.

Format rules enforced

Length and character set are validated per symbology, so you find out about a problem here rather than after printing a thousand labels.

Vector output

SVG keeps the bars perfectly crisp at any size, which matters because a slightly soft barcode is a barcode that fails to scan.

Runs in your browser

Product codes and shipping references are drawn locally and never uploaded.

Good to know

Barcode Generator limitations

  • Generating an EAN or UPC does not register it. Real retail codes must be bought from GS1, and an invented one may collide with an existing product.
  • Print quality decides whether a barcode scans, so a low-resolution print or an unsuitable material will fail regardless of the image.
  • The quiet zone — the clear margin either side — must be preserved in your layout or scanning becomes unreliable.
  • Two-dimensional formats such as Data Matrix are not covered; use the QR generator for those.

Summary

Barcode Generator in short

  • EAN and UPC check digits are computed from the other digits and cannot be arbitrary.
  • Code 128 handles letters and any length; EAN and UPC are digits at a fixed length.
  • Download SVG for print, since crispness determines whether it scans.
  • Generating a retail barcode does not register it — those must be bought from GS1.
  • Everything runs in your browser.

FAQ

Barcode Generator questions

What is a check digit and why does it matter?

It is the final digit, calculated from all the others by a weighted sum. Scanners recompute it and reject the code if it does not match, which catches most misreads. Choosing it arbitrarily produces a code that either fails to scan or reads as a different product.

Which barcode format should I use?

EAN-13 for retail products outside North America and UPC-A within it. Code 128 for anything internal — part numbers, asset tags, shipping references — since it takes letters and any length. Code 39 only where older hardware requires it.

What is the difference between EAN-13 and UPC-A?

UPC-A is twelve digits and used mainly in North America; EAN-13 is thirteen and used globally. A UPC-A is effectively an EAN-13 with a leading zero, and modern scanners read both.

Can I invent my own retail barcode?

Not for sale through retailers. EAN and UPC numbers are allocated by GS1 and the prefix identifies your company, so an invented number may already belong to somebody else's product. For internal use, any format you like is fine.

Why does my printed barcode not scan?

Most often the quiet zone has been lost — the clear margin either side of the bars, which must be about ten times the width of the narrowest bar. Other common causes are printing too small, low resolution, or poor contrast on a coloured background.

Should I use PNG or SVG for printing?

SVG. The bars stay mathematically exact at any size, whereas a PNG scaled up gets soft edges that scanners struggle with. Barcode reliability depends almost entirely on edge sharpness.

Why does Code 128 have no fixed length?

It encodes characters individually rather than in a fixed pattern, so it takes any length and the full ASCII set. That flexibility is why it dominates logistics, where references vary in shape between systems.

Should I show the digits under the barcode?

Almost always yes. If the scan fails, someone can key the number in manually — and for retail codes the human-readable line is required by the GS1 specification rather than optional.

Is my product data sent anywhere?

No. The barcode is drawn in your browser. Product codes and shipping references are commercially sensitive, and none of it is transmitted or logged.

Discover

Related developer tools