Skip to content
ToolkitHub

Barcode Generator

Generate barcodes (EAN, UPC, Code128)

Guide

Choosing the right barcode format

By Logappradeep · ServiceNow developer

Linear (1D) barcodes encode data in the varying widths of parallel bars and spaces. A laser or camera scanner reads the pattern from one side to the other and turns it back into characters, which makes barcodes one of the fastest and cheapest ways to identify physical objects. This generator supports six common symbologies, validates your input for the chosen format, and lets you download the result as a scalable SVG.

The formats and when to use them

  • Code 128: encodes all 128 ASCII characters, including lowercase letters and punctuation. It automatically packs pairs of digits into single symbols, so numeric data stays compact. The default choice for inventory labels, asset tags, internal shipping labels, and tracking numbers.
  • Code 39: an older, simpler symbology limited to uppercase A–Z, digits, space, and - . $ / + %. Still required by some industrial, automotive, and government systems.
  • EAN-13: the 13-digit retail product barcode used internationally. Enter 12 digits and the check digit is calculated for you, or enter all 13.
  • EAN-8: a compact 8-digit version for small packages; enter 7 or 8 digits.
  • UPC-A: the 12-digit retail barcode used mainly in the United States and Canada; enter 11 or 12 digits.
  • ITF-14: a 14-digit code printed on outer cartons and cases in logistics; enter 13 or 14 digits.

How check digits work

Retail and logistics formats end with a check digit computed from the other digits with a weighted sum modulo 10. When a scanner misreads one bar, the check digit no longer matches, and the scan is rejected instead of returning a wrong product. Code 128 uses a similar idea internally, with a check character calculated modulo 103 and added automatically, so you only ever type your data.

A note on retail barcodes

Generating a valid EAN or UPC image is easy; having a valid product number is not. Retailers expect numbers assigned through GS1, the organization that issues company prefixes and product identifiers. Inventing a number, or encoding a product number as Code 128, creates a barcode that scans but will not be recognized by retail point-of-sale systems. Use the generator to render GS1 numbers you already own, or for internal labels where any numbering scheme works.

Printing and scanning tips

  • Keep the quiet zone. Text or graphics too close to the bars is a common reason scans fail.
  • Scale proportionally. The SVG download stays sharp at any size, but stretching it in only one direction distorts the bar ratios.
  • Use high contrast. Black bars on a white background are the most reliable. Red bars are invisible to many laser scanners, which use red light.
  • Keep values short. Every character adds width, and very long barcodes are hard to fit on a label and to scan in one pass.
  • Test with your scanner at the actual print size before producing a batch of labels.

Barcodes are drawn in your browser as you type, and the SVG file is created on your device; nothing is uploaded.

Frequently asked questions

Which barcode should I use for products sold in stores?

EAN-13 internationally or UPC-A in North America, using a product number assigned through GS1. Code 128 is meant for internal labels, logistics, and asset tracking.

Do I need to calculate the check digit?

No. For EAN-13, EAN-8, UPC-A, and ITF-14 you can leave it off and it is added for you; Code 128 adds its check character automatically.

Why is my Code 128 content rejected?

Code 128 supports ASCII characters only, so accented letters and emoji cannot be encoded. Replace them with plain ASCII text.

Why will my barcode not scan?

Common causes are a missing quiet zone, uneven stretching, low contrast, or printing too small for the scanner. Print it larger with clear margins and test again.