Skip to main content

Free tool · Barcodes

Barcode generator: make an EAN-13 or Code 128 barcode for your labels

Type a product code or SKU and download the barcode. EAN-13 gets its check digit added for you; Code 128 takes letters, digits and symbols. The barcode is drawn in your browser and nothing is uploaded.

Last updated:

Published:

Make an EAN-13 or Code 128 barcode

In shortThis free generator turns a product code into an EAN-13 or Code 128 barcode you can download as PNG or SVG and print on labels. For EAN-13 type 12 digits and the check digit is added, or 13 digits and it is verified. Code 128 takes up to 40 letters, digits or symbols. Everything is drawn in your browser.

Barcode type

Type 12 digits and the check digit is added, or 13 digits and the check digit is verified.

EAN-13 numbers that start with 2 are meant for use inside your own business.

Print a test label and scan it with the scanner you will use before you print a full run.

Everything stays in your browser. Nothing is uploaded or saved.

Preview

Type a code to see the barcode.

How an EAN-13 check digit and symbol are built

In shortAn EAN-13 has 13 digits: twelve data digits and a check digit. The check digit is found by weighting the twelve digits alternately 1 and 3, adding them, and taking the amount that rounds the sum up to the next ten. The symbol is drawn as 95 modules, narrow bar or space units, between guard bars.

The check digit
sum   = d1*1 + d2*3 + d3*1 + d4*3 + ... + d11*1 + d12*3
check = (10 - (sum mod 10)) mod 10

A worked example

Check digit of 590123412345
StepWorkingResult
Twelve digitsTyped by you590123412345
Weighted sum5*1 + 9*3 + 0*1 + 1*3 + 2*1 + 3*3 + 4*1 + 1*3 + 2*1 + 3*3 + 4*1 + 5*383
Check digit(10 - (83 mod 10)) mod 107
Full EAN-13Twelve digits, then the check digit5901234123457

The 95 modules of the symbol

The first digit is not drawn as bars. It chooses which of two bar patterns each of the six left digits uses, which is how a scanner reads the first digit back. The six right digits always use one pattern.

Layout of an EAN-13 symbol
PartModules
Start guard3
Six left digits (7 modules each)42
Centre guard5
Six right digits (7 modules each)42
End guard3
Total95

How Code 128 picks a subset and its checksum

In shortCode 128 stores any printable ASCII text. The generator uses subset C, which packs two digits into each symbol, when the code is an even run of digits, and subset B otherwise. The checksum is the start value plus each symbol value times its position, modulo 103, and each symbol is 11 modules wide.

Two Code 128 examples, computed by the generator
CodeSubsetChecksumModules
123456C4468
SKU-00123B32134
The symbols for 123456 are 105, 12, 34, 56, 44, 106: the start symbol, three digit pairs, the checksum and the stop symbol. Code 128 cannot hold Arabic or other non-ASCII letters, so write codes in Latin letters and digits.
The rules
subset C: an even number of digits, two digits per symbol
subset B: any other text of printable ASCII characters
checksum = (start + 1*v1 + 2*v2 + 3*v3 + ...) mod 103
modules  = 11 per symbol (start, data, checksum) + 13 for the stop symbol

Printing labels that scan

In shortA barcode scans best when it is printed dark on a light background with its blank margin left intact. Download the SVG for sharp scaling or the PNG for quick use, print a few labels, and test-scan one with the scanner you will use at the counter. Scanners in keyboard mode type the code like a keyboard.

  • Keep the blank marginThe downloaded image includes a blank margin on both sides of the bars. Do not crop it, because a scanner uses it to find where the barcode starts.

  • Scale it evenlyEnlarge or reduce the image in proportion. Stretching it in one direction changes the bar widths a scanner relies on.

  • Test-scan a printed labelPrint one label, scan it into a text box and check that the whole code appears. Do this on the printer and scanner you will really use. Setup steps are in the thermal printer and barcode setup guide.

  • Check the hardware firstNot sure your scanner or label printer will work with your computer? Use the POS hardware checker before you buy rolls of labels.

Which numbers you can use: internal codes and GS1

In shortEAN-13 numbers that start with 2 are meant for use inside your own business, such as shelf labels and weighed goods. To sell through other shops, products normally carry numbers registered with GS1, so ask GS1 or your buyer. For an internal SKU or a code with letters, such as a shelf, batch or purchase order, use Code 128.

The POS scans these barcodes at the counter, and the purchase and inventory module keeps the item codes behind them.

Frequently asked questions

Can I use these codes on products sold in other shops?

EAN-13 numbers that start with 2 are meant for use inside your own business, such as shelf labels and weighed goods. To sell through other shops, products normally carry numbers registered with GS1. Ask GS1 or your buyer.

Which type should I choose, EAN-13 or Code 128?

Choose EAN-13 for a thirteen-digit retail number. Choose Code 128 for an internal SKU or a code with letters, such as a shelf, a batch or a purchase order. Code 128 holds up to 40 Latin letters, digits and symbols in this tool.

Why does EAN-13 need a check digit?

The last digit lets a scanner catch a misread or a mistyped number: if the twelve digits and the check digit do not agree, the code is rejected. Type 12 digits and the tool adds the right one, or type 13 and it tells you the digit it expected.

Will my barcode scanner read the printed label?

Usually, if the label is printed dark on a light background, scaled evenly and with its blank margin intact. Scanners in keyboard mode type the code into the selected box. Print one label and scan it before you print a roll.

Is what I enter sent anywhere?

No. The calculation runs in your browser with no network request and nothing is stored. Closing or reloading the page clears what you typed. The only thing that can leave the page is a result you choose to copy or download.

No install needed

Download RaqamBooks and run your business offline

Install it on your own computer, keep your data local and avoid per-user monthly cloud fees. Early version for Windows 10/11 and macOS 13 or later (Apple chip and Intel chip).

Download for WindowsWindows 10/11 · 64-bit · choose your country edition
Download for macOSmacOS 13+ · Apple chip or Intel chip · choose your country edition
Try the demo (opens in a new tab)Runs in your browser · sample data

All downloads, checksums and install guideSee pricingTalk to us