Free tool

Code 128 Barcode Generator

Turn any number or text into a scannable Code 128 barcode. Download it as PNG or SVG for product labels, packaging, inventory and shipping.

Code 128B – supports letters, numbers, and most special characters

80px

Sell products with barcodes on YNS

Add SKUs and manage your product catalog easily.

Start free

What is a Code 128 barcode?

Code 128 is a high-density linear barcode that can encode all 128 ASCII characters: upper- and lower-case letters, digits, punctuation and control characters. It is standardised as ISO/IEC 15417 and is read by practically every handheld, fixed and camera-based barcode scanner, which is why it has become the default barcode for logistics, warehousing and e-commerce.

Every Code 128 barcode has the same structure:

  • A blank quiet zone on the left, so the scanner can find where the barcode begins
  • A start character that tells the scanner which code set follows
  • The encoded data, one symbol per character
  • A check character calculated from the data, which catches misreads
  • A stop character and a second quiet zone on the right

Code 128 has three code sets. Code set A covers upper-case letters, digits and control characters, code set B covers upper- and lower-case letters, digits and symbols, and code set C packs pairs of digits into a single symbol. This generator uses code set B, which accepts any printable character you can type, so you never need to pick a code set yourself.

Code 128 vs EAN, UPC and Code 39

Which barcode you need depends on who is going to scan it. Code 128 is a general-purpose format; the others exist for specific supply chains.

  • Code 128 – internal SKUs, order numbers, warehouse bins, asset tags and shipping labels. Variable length, letters and numbers.
  • EAN-13 and UPC-A – products sold through retail checkouts and marketplaces. Fixed length, digits only, and the number must be a GTIN licensed from GS1 rather than one you make up.
  • Code 39 – an older format still required by some automotive, defence and healthcare systems. Upper-case only and noticeably wider than Code 128 for the same data.
  • GS1-128 – Code 128 with GS1 application identifiers, used on pallet and carton labels (for example an SSCC). Use it when a retailer or 3PL asks for GS1-128 specifically.

If you only need your own team or your own scanner to read the code, Code 128 is almost always the right answer.

How to turn numbers into a barcode

  1. Type the number into the field above exactly as it should scan. Leading zeros, dashes and letters are kept, so 000123 and SKU-000123 produce different barcodes.
  2. Choose a bar height. Taller bars are easier to scan with handheld scanners and phone cameras.
  3. Leave “Show text below barcode” on so people can read the number too.
  4. Click Generate barcode, then download it. Use SVG for print design tools and labels that may be resized, and PNG for documents, spreadsheets and label software that only accepts images.

Need a barcode for every product? Generate one per SKU and name the files after the SKU. If you sell online with Your Next Store, the same SKU you print on the shelf label is the one you track stock against.

Printing and scanning tips

  • Print at 100% scale. “Fit to page” shrinks the bars unevenly and is the most common reason a barcode stops scanning.
  • Keep the white margins. The quiet zone on each side should be at least ten times the width of the narrowest bar; the downloaded files already include it.
  • Use black bars on a white or very light background. Red and light grey bars are invisible to many laser scanners.
  • On thermal label printers (typically 203 or 300 dpi), import the SVG or the high-resolution PNG rather than a screenshot, so bar edges stay sharp.
  • Keep data short. Every extra character makes the barcode wider; if it no longer fits the label, shorten the SKU instead of shrinking the image.
  • Test before you print a full run. Scan a sample with the scanner your team uses and check that it returns exactly the text you entered.

Printing shipping labels as well? Try the free shipping label template.

Frequently asked questions

How do I create a Code 128 barcode?

Type the text or number you want to encode into the field above, pick a bar height and click Generate barcode. The generator adds the start character, the check character and the quiet zones for you, so the result is a complete Code 128 barcode you can download as PNG or SVG.

How do I turn a number into a barcode?

Enter the number exactly as you want a scanner to read it, including any leading zeros, and generate the barcode. Code 128 encodes digits, letters and symbols, so order numbers, SKUs and serial numbers all work. When scanned, the barcode returns the same number you typed.

Is this Code 128 barcode generator free?

Yes. The generator is free with no account, no watermark and no limit on how many barcodes you make. The barcode is drawn in your browser, so the data you enter is never uploaded.

What is the difference between Code 128 and Code 39?

Code 39 only encodes 43 characters (upper-case letters, digits and a few symbols) and produces a wider barcode for the same data. Code 128 encodes all 128 ASCII characters, including lower-case letters, and packs them more densely, so it is the better choice for new labels unless a partner specifically requires Code 39.

Can I use a Code 128 barcode on retail products?

Not for checkout scanning in most retail stores or on marketplaces such as Amazon. Those expect a UPC or EAN barcode built from a GTIN licensed by GS1. Code 128 is the right choice for internal SKUs, warehouse bins, order numbers, asset tags and shipping labels.

What is a linear barcode?

A linear (one-dimensional) barcode stores data in the widths of parallel bars and spaces and is read in a single line by a laser or camera scanner. Code 128, Code 39, UPC and EAN are linear barcodes. QR codes and Data Matrix are two-dimensional and need a camera-based scanner.

Why won't my barcode scan?

The most common causes are printing at a reduced scale, cropping the white margins on either side, low contrast (grey bars or a coloured background) and bars too short for the scanner. Print at 100% size in black on white, keep the quiet zones intact and test with the scanner you will actually use.