Skip to content
MoneyDeck

Barcode Generator

Make scannable UPC, EAN, Code 128 and Code 39 barcodes — download as SVG or PNG

Updated · Free, no signup

About the Barcode Generator

This barcode generator turns numbers or text into a scannable barcode right in your browser. It supports the retail symbologies UPC-A (12 digits, used in the US and Canada) and EAN-13/EAN-8 (used worldwide and for ISBN book numbers), plus Code 128 and Code 39 for shipping labels, asset tags, inventory bins and internal part numbers. The check digit is calculated for you, or verified if you type the full number.

It is useful for small sellers labelling stock, warehouse teams printing location tags, teachers and event organisers making ticket codes, and developers who need test barcodes. Download the result as a crisp SVG for print or a PNG for documents, and adjust the bar width and height to fit your label.

A barcode only encodes the number — it does not register it. To sell through retailers you need GS1-issued UPC/EAN numbers for your company; for internal use, Code 128 is usually the best choice because it is compact and encodes letters, digits and punctuation.

How to use the barcode generator

  1. 1Choose the barcode type: UPC-A or EAN-13 for retail products, Code 128 for labels and inventory.
  2. 2Type the number or text. For UPC/EAN you can leave off the last digit and it will be calculated.
  3. 3Adjust bar width and height to suit your label size.
  4. 4Check the status line says Valid, then download the SVG (for print) or PNG.
  5. 5Test-scan the printed barcode with a phone app or scanner before printing in bulk.

Formula and method

UPC/EAN check digit = (10 − (3 × Σ odd-position digits from the right + Σ even-position digits) mod 10) mod 10

UPC and EAN barcodes end in a GS1 mod-10 check digit. Starting from the rightmost data digit, digits are weighted 3, 1, 3, 1…; the check digit is the amount needed to round the weighted sum up to the next multiple of 10. A scanner recalculates it on every read and rejects the scan if it does not match.

Each EAN/UPC digit becomes 7 modules (two bars and two spaces). An EAN-13 is 95 modules: start guard 101, six left digits, centre guard 01010, six right digits and end guard 101; the first digit is encoded by the odd/even parity pattern of the left half. Code 128 uses 11 modules per symbol plus a 13-module stop, with a weighted mod-103 check symbol, and switches to its numeric set C to pack two digits per symbol. Code 39 uses 15 modules per character with a one-module gap and an optional mod-43 check character.

module
Width of the narrowest bar or space (the X-dimension)
quiet zone
Blank margin required before and after the bars

Worked examples

UPC-A for a retail product

Weighting the 11 digits 3,1,3,1… from the right gives 3×(0+6+0+2+1+5) + (3+0+0+9+4) = 42 + 16 = 58. The next multiple of 10 is 60, so the check digit is 2. The UPC-A symbol is 95 modules; with the minimum 9-module quiet zone on each side and 2px bars it needs (95 + 18) × 2 = 226 px of width.

EAN-13 check digit

Reading the 12 digits from the right, the digits in odd positions (3, 3, 3, 8, 6, 0) sum to 23 and are weighted by 3, giving 69; the even-position digits (9, 3, 1, 3, 0, 4) sum to 20. The total is 89, so the check digit is 90 − 89 = 1 and the full code is 4006381333931, drawn in 95 modules.

Code 128 shipping label

Code 128 encodes “MONEYDECK-” with set B (one symbol per character) and switches to set C for “2026” (two digits per symbol): start + 10 + switch + 2 + check = 15 symbols × 11 modules + 13-module stop = 178 modules. With 10-module quiet zones and 2px bars it needs (178 + 20) × 2 = 396 px of width.

Code 39 asset tag with mod-43 check

Code 39 has no lowercase, so the text becomes CODE39. The character values C=12, O=24, D=13, E=14, 3=3, 9=9 sum to 75; 75 mod 43 = 32, which is the letter W. With start and stop asterisks the symbol has 9 characters: 8 × (15 + 1 gap) + 15 = 143 modules.

Wrong check digit is caught

The first 12 digits require check digit 1, so a code ending in 2 is rejected — exactly what a checkout scanner would do.

Frequently asked questions

Can I use these barcodes to sell products in stores?+

The barcode image is standard and scannable, but retailers and marketplaces require UPC/EAN numbers licensed from GS1 for your company. Generate the image here once you have your GS1 number.

What is the difference between UPC and EAN?+

UPC-A has 12 digits and is used mainly in the US and Canada; EAN-13 has 13 digits and is used worldwide. A UPC-A is the same barcode as an EAN-13 that starts with 0.

Which barcode type should I use for inventory?+

Code 128 is the usual choice for internal labels: it encodes letters, digits and punctuation, is denser than Code 39 and includes a mandatory check symbol for reliable scanning.

How is a UPC check digit calculated?+

Multiply the digits in odd positions (1st, 3rd, … 11th) by 3, add the digits in even positions, and take the amount needed to reach the next multiple of 10. For 03600029145 that is 2.

Should I download SVG or PNG?+

Use SVG for printing and label software — it is vector, so the bars stay perfectly sharp at any size. Use PNG for documents, spreadsheets or websites that do not accept SVG.

Related tools