QR and barcodes

Barcode generator

Code 128 takes text. EAN-13 and UPC-A take digits and add the check digit when you leave it off. The drawing stays on this page.

The barcode is drawn in your browser. Nothing you type is uploaded.

How it works

Code 128 can hold letters and numbers, which suits a SKU or a membership id. EAN-13 is the 13-digit retail code. You can type 12 digits and the page adds the check digit, or type all 13 if you already have a valid code. UPC-A is 12 digits, from 11 digits plus a check digit, with the same idea.

The check digit is a weighted sum so a scanner can tell a smudged code from a wrong one. The picture is an SVG drawn in your browser. Nothing you type is uploaded. A square code for a URL is the QR code generator, not a barcode.

Formula

  • EAN-13 check
    from the left, odd digits ×1, even digits ×3; check = (10 − sum mod 10) mod 10
  • UPC-A check
    from the left of 11 digits, odd ×3, even ×1; same remainder rule

Worked examples

A known EAN-13

400638133393 plus the check digit is 4006381333931. Typing the 12 digits is enough. The page appends 1.

A known UPC-A

03600029145 plus the check digit is 036000291452. That is the classic example used to test the weighting.

Which symbology
CodeYou typeTypical use
Code 128Letters or digitsInternal SKUs
EAN-1312 or 13 digitsRetail outside the US
UPC-A11 or 12 digitsRetail in the US

Common questions

Is the number uploaded?

No. The barcode is drawn in your browser from the text you typed.

Why was my EAN rejected?

It needs 12 digits, or 13 digits that already include the correct check digit. Letters are not allowed. Code 128 is the format for mixed text.

Does the SVG print sharply?

Yes. It is vectors, not a photo of bars. Drop it into a label template at the size the scanner expects. Very small prints fail even when the math is right.

Can this look up a product?

No. It only draws the symbol for the digits you provide. It does not query a product database.