Barcode Generator

Draws Code 128, EAN-13, EAN-8 and UPC-A barcodes as SVG or PNG, works out the check digit, and writes the TSPL command for a TSC printer or the ZPL for a Zebra. Enter the label size and the printer's resolution, and the barcode is centred on the label for you.

Barcode

Barcode type

Letters, digits and symbols: stock codes, serial numbers, shelf locations. ASCII only.

The width of the thinnest bar. Handheld scanners read 0.25 mm and up comfortably: 2 dots at 203 dpi, 3 at 300 dpi, 6 at 600 dpi.

Label

The gap between two labels; 0 for continuous stock.

Printer resolution

It is on the label underneath the printer; most desktop TSC and Zebra models are 203 dpi.

How many of each label to print.

If labels come out upside down.

When off, you give the position in dots from the label's top left corner.

Preview

187 modules · 46.8 × 14.8 mm
KRS-2026-0042

Code 128 barcode ready: KRS-2026-0042, 46.8 × 14.8 mm.

SVG and PNG download at the size the printer would print. The PNG carries 203 dpi, so Word or InDesign places it at its real size.

KRS-2026-0042
50 × 30 mm · 400 × 240 dots · X 33 · Y 61

Printer command

1 label

For TSC printers and compatibles that speak TSPL. Paste it into the command window of TSC's Diagnostic Tool or TSC Console, or send the file to the printer raw.

TSPL
SIZE 50 mm,30 mm
GAP 2 mm,0 mm
DIRECTION 1
REFERENCE 0,0
CLS
BARCODE 33,61,"128",96,2,0,2,2,"KRS-2026-0042"
PRINT 1

Check digit

Number type

EAN-13 product number: most products on a shelf

Type it without the check digit and it is calculated; type the whole number and it is verified. Spaces, dots and dashes are ignored.

5901234123457

Check digit: 7

Working

Starting from the right, the digits are multiplied by 3 and 1 in turn and the products added up.

Digit590123412345
Weight×1×3×1×3×1×3×1×3×1×3×1×3
Product52703294329415

Sum 83; the amount that brings it up to a multiple of ten (90) is 7, and that is the check digit.

Let’s make it yours

Need a version of this with your brand on it, wired into your own systems? Bulk jobs, an API, a panel or an automation — tell us about it and we will scope it together.

Let’s make it yours →

A barcode generator that goes as far as the label printer

Making a barcode has two halves: drawing the bars correctly, and getting them to a label printer at the right size. This barcode generator does both. As a Code 128 generator it encodes letters, digits and symbols, choosing the switches between code sets A, B and C that give the shortest symbol. For EAN-13, type 12 digits and it adds the check digit; type 13 and it verifies it.

The difference is on the printer side. It works as a TSPL generator for TSC printer barcode labels and as a ZPL generator for Zebra: enter the label's width, height and gap and the printer's resolution (203, 300 or 600 dpi), and the barcode's width is worked out module by module and centred on the label. If it does not fit, or its quiet zone would be clipped, you hear about it before printing. In batch mode every line becomes a label; paste a spreadsheet column, formatted as text so leading zeros survive.

The EAN-13 check digit calculator also handles GTIN-8, GTIN-12, GTIN-14 and SSCC-18 and shows the working digit by digit. The SVG downloads sized in millimetres and the PNG with the printer's resolution written into it, so Word or a layout program places it at print size. It all happens in your browser: nothing you type reaches a server, and there is no sign-up or watermark.

Made by KARSH

A software company based in Erzurum and Istanbul. Web, mobile, desktop, automation and AI. karsh.app

Questions

How is the EAN-13 check digit calculated?

Starting from the right, the first 12 digits are multiplied by 3 and 1 in turn and added up. The check digit is whatever brings that sum up to a multiple of ten: for 590123412345 the sum is 83, so the check digit is 7.

Where do I get an EAN-13 barcode number?

For products sold in shops, from the GS1 member organisation in your country; a made-up number can clash with another company's product. This tool does not issue numbers, it turns the one you have into a barcode.

Can Code 128 encode letters like é, ç or ş?

No. Code 128 carries ASCII characters only, and accented letters fall outside it. The tool names the characters it cannot encode, and folds Turkish letters to their plain Latin equivalents in one click.

What is the difference between TSPL and ZPL?

Both are label printer command languages: TSPL is TSC's, ZPL is Zebra's. Many TSC models understand ZPL as well; the manual or the settings menu tells you which one your printer speaks.

Which dpi should I choose?

The printer's resolution is on the label underneath it or in its manual; most desktop TSC and Zebra models are 203 dpi. At 203 dpi a millimetre is 8 dots, at 300 dpi it is 12, and every measurement in the command is written at that ratio.

More tools

[06]

Quote

MAG1 / 6

Six questions, two minutes. At the end I show you what I understood — every line is editable before it goes anywhere.

What would you like built?

Only what you type into this form, and which tool you sent it from, is stored.