Barcode Generator

Create Code 128, EAN-13, EAN-8, UPC-A, Code 39 and ITF-14 barcodes and download SVG or PNG.

Barcode Generator tool

2 px
90 px

About the Barcode Generator

Products, shipping cartons, library books and stock labels all rely on barcodes that scanners can read first time. This barcode generator creates Code 128, EAN-13, EAN-8, UPC-A, Code 39 and ITF-14 barcodes, calculates the check digit automatically and shows the human-readable text underneath: for the EAN-13 number 896123456789, the check digit is 4. Download SVG for crisp printing or PNG for screens. Retail barcodes must use numbers assigned by GS1, whose prefix for Pakistan is 896, so do not invent numbers for products sold in shops.

Six common symbologies are supported. Code 128 encodes any letters, digits and symbols compactly and switches automatically to its numeric mode for runs of digits. EAN-13 and UPC-A are the retail barcodes on consumer products, EAN-8 is the short version for small packs, Code 39 is the older alphanumeric code still used in industry and government, and ITF-14 marks outer shipping cartons.

Check digits are calculated for you: enter the first 12 digits of an EAN-13, 11 of a UPC-A, 7 of an EAN-8 or 13 of an ITF-14, and the final digit is added. If you enter a full number, the check digit is verified, which catches typing mistakes before anything is printed. Retail barcodes use the standard guard bars and digit grouping, and quiet zones are included so scanners can read the code reliably.

Remember that the numbers on retail products must come from GS1, the organization that issues company prefixes; this tool draws the barcode but does not register numbers. For two-dimensional codes, use the QR code generator, and to share network access, the WiFi QR code generator.

How to use the Barcode Generator

  1. Choose the typePick Code 128 for general text, EAN-13 or UPC-A for retail products, or another type.
  2. Enter the dataType the text or digits. Check digits are added or verified automatically.
  3. Adjust the lookSet the bar width, height, colors and whether to show the text.
  4. DownloadSave the barcode as SVG for print or PNG for documents.

Barcode Generator features

  • Code 128 with automatic numeric mode
  • EAN-13, EAN-8 and UPC-A with guard bars
  • Code 39 with optional check character
  • ITF-14 for shipping cartons
  • Check digits calculated and verified
  • SVG and PNG downloads
  • Bar width, height and colors
  • Quiet zones included

Common uses

  • Labelling stock and inventory items
  • Printing product barcodes from GS1 numbers
  • Creating asset tags and library labels
  • Adding barcodes to packaging designs
  • Testing barcode scanners and apps

Barcodes in practice: labelling a shop's own stock, checking an EAN-13 number, printing on label printers, sizes and quiet zones

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

Barcodes let shops, warehouses, schools and offices identify items with a quick scan instead of typing codes. Generating them is easy; making them scan reliably on real printers and scanners takes a little care. This guide labels a shop's own stock, works through an EAN-13 check digit and covers label printers, sizes, quiet zones, asset tags and stock counts.

A worked example: labelling a shop's stock

A clothing shop with its own point-of-sale system labels items with internal codes, such as KT-01-M for a medium kurta in style one. Code 128 handles letters, digits and hyphens, so the shop generates a barcode for each code, prints labels on a thermal label printer and scans them at the till. Sales and stock levels now update instantly without typing.

When registered numbers are needed

Products sold through supermarkets, chains and many marketplaces usually need GS1-registered numbers, such as EAN-13, which identify the product worldwide. In Pakistan these numbers come through GS1 Pakistan, and they begin with the prefix 896. Internal codes are fine for a shop's own system but not for selling through others.

Checking an EAN-13 number

The last digit of an EAN-13 number is a check digit calculated from the first twelve. For the twelve digits 896123456789, the check digit works out to 4, giving 8961234567894. Scanners use the check digit to catch misreads, so a number with the wrong final digit fails to scan or is rejected by systems.

Label printers

Thermal label printers are common in shops and warehouses. Their resolution limits how thin bars can be, so make barcodes large enough for the printer to reproduce cleanly. Print a test label and scan it with the actual scanner before printing a full roll.

Use vector files and avoid stretching

Stretching or squashing a barcode image changes the ratio between bar widths and can make it unreadable. Downloading SVG and scaling it evenly in design software keeps bars accurate. If PNG is required, generate it at the final size instead of resizing afterwards.

Quiet zones and contrast

Barcodes need clear space on both sides, called quiet zones, so scanners can find where the code begins and ends. Black bars on a white background give the best contrast; red bars are invisible to many scanners, which use red light.

Asset tags

Schools, offices and libraries tag equipment and books with barcodes to track loans and inventory. Code 128 suits such tags, and durable label material resists wear on items handled often, such as laptops and textbooks.

Stock counts

With every item labelled, stock counts become a matter of scanning shelves with a handheld scanner or a phone app. Regular counts compared with sales records reveal shrinkage, misplaced items and data entry errors early.

Common mistakes

  • Using internal codes where registered numbers are required.
  • Stretching barcode images to fit labels.
  • Printing bars in colours scanners cannot read.
  • Leaving no quiet zone around the code.

Related tools

For codes that store web addresses and text, use QR Code Generator. To prepare invoices for labelled products, try Invoice Generator, and to read codes with a camera, QR Code Scanner.

Prices live in the system

A barcode usually identifies the product, while the price is stored in the shop's system. Changing a price then means updating it once in the system rather than relabelling every item. Shops that print prices into barcodes lose this flexibility and risk mismatches at the till.

Printing labels from spreadsheets

Many label programs can read a spreadsheet of product codes and names and print a barcode label for each row. Preparing the list once and printing in bulk is far faster than generating labels one by one, and it keeps codes and names consistent.

Batches and expiry dates

Food and medicine suppliers often need to encode batch numbers and expiry dates as well as product codes. GS1-128 barcodes support this using standard prefixes called application identifiers. Retailers and distributors may require this format, so check their requirements before printing.

Damaged labels

Scuffed or torn barcodes fail to scan. Keep a way to enter codes manually at the till, and print the code's characters beneath the bars, so a damaged label does not hold up a customer. Replacing worn shelf labels regularly prevents delays.

Scanning with phones

Phone apps can scan barcodes for stock counts and simple inventory, which suits small shops without dedicated scanners. Test your labels with the phone app you plan to use, since phone cameras may struggle with very small or low-contrast codes.

Durable labels

In warehouses, kitchens and outdoor storage, paper labels smudge and peel. Synthetic label materials and protective coatings resist moisture, heat and handling, keeping barcodes readable for the life of the item or shelf.

Testing before a big print run

Before printing hundreds of labels, print a few, stick them on real products and scan them at the till and with any handheld scanners. Curved bottles, glossy packaging and small items can make otherwise good barcodes hard to read, and testing reveals the problem early.

Privacy

Barcodes are generated in your browser. Nothing is uploaded or stored.

Further reading: QR Codes Explained: How They Work and How to Make Ones That Scan.

Frequently asked questions

Which barcode type should I use?

Use EAN-13 (or UPC-A in North America) for retail products with numbers from GS1, ITF-14 for shipping cartons, and Code 128 for anything else, such as internal stock codes, serial numbers and shipping labels, because it encodes any text compactly.

Do I need to register my barcode numbers?

For products sold through retailers, yes. EAN and UPC numbers must start with a company prefix licensed from GS1, so they are unique worldwide. For internal labels such as asset tags, you can use any Code 128 or Code 39 text.

What is a check digit?

The last digit of an EAN, UPC or ITF-14 number, calculated from the others with a weighted sum. Scanners recompute it to detect misreads. Enter the number without it and the tool adds it, or enter the full number to have it checked.

Should I download SVG or PNG?

SVG is a vector format, so the bars stay perfectly sharp at any size, which is best for printing and design software. PNG is a picture made of pixels, convenient for documents, spreadsheets and websites; use a larger bar width for bigger PNGs.

How big should a printed barcode be?

Retail EAN-13 codes are designed for about 37 by 26 millimetres at 100 percent, and should not be printed much smaller than 80 percent. Keep the white quiet zones on both sides, and print dark bars on a light background.

Can I change the colors?

Yes, but scanners need strong contrast. Dark bars on a white or light background work best; red bars and inverted colors often fail, because many scanners use red light and expect dark bars.

Is anything uploaded?

No. The barcode is calculated and drawn by code running in this page on your own device. Nothing is sent to a server or stored.