Barcode generator

Type text or digits and get a barcode you can save as a PNG or a scalable SVG. The bars are drawn on your device by our own encoder; nothing is uploaded.

Barcode type
Letters, digits and punctuation (ASCII 32–126). Digits only, in an even count, are packed more tightly.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Choose Code 128 or EAN-13.
  2. Type the content. Both formats show an example you can replace.
  3. Pick colours if you need something other than black on white, then press Download PNG or Download SVG.

Use SVG for print, because it stays sharp at any size. PNG is handy for documents and web pages.

How the encoders work

Code 128. Every character is a symbol of 11 modules (three bars and three spaces). A message is a start symbol, the character values, a check symbol and a stop symbol. The check symbol is the start value plus each character value multiplied by its position, taken modulo 103. A string of digits with an even length uses the compact subset C, which packs two digits into one symbol; anything else uses subset B, which covers ASCII 32 to 126.

EAN-13. 13 digits become 95 modules: a start guard, six digits on the left, a centre guard, six digits on the right and an end guard. The first digit is not drawn directly; it selects which of two patterns (L or G) is used for each digit on the left.

Example

The text A in Code 128 has start value 104, character value 33 and check value (104 + 33) mod 103 = 34, so the symbols are 104, 33, 34 followed by the stop.

Tips

  • Keep the empty margin around the bars; scanners need it.
  • Do not stretch the image in one direction. Scale it evenly.
  • Very long Code 128 text makes a wide barcode that is hard to scan on small labels.

Frequently asked questions

Which barcode type should I choose?

Use EAN-13 for retail product codes, which must be 13 digits and are normally assigned through GS1. Use Code 128 for everything else: order numbers, shipping labels, inventory tags, anything with letters.

How is the EAN-13 check digit calculated?

The first 12 digits are weighted 1, 3, 1, 3 and so on from the left, the weighted sum is added up, and the check digit brings that sum to the next multiple of 10. For 590123412345 the sum is 83, so the check digit is 7.

Does this make real, scannable barcodes?

Yes, the bar patterns follow the Code 128 and EAN-13 specifications, including quiet zones. Print at a reasonable size with dark bars on a light background, and test with the scanner you will use. An EAN-13 number is only a valid product code if it was issued to you.

Is my text sent to a server?

No. The barcode is built in your browser and the files are created on your device.

More in Generators

All tools in this category: Generators ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.