What a barcode is and why you might need one

A barcode is a machine-readable image made of parallel lines or a grid of squares that encodes information — usually a product number, inventory ID, or document reference. When you scan a barcode with a reader or smartphone camera, the software decodes those lines or squares back into the original data. Barcodes appear on retail products, shipping labels, library books, and internal inventory systems because they are faster and more accurate than typing numbers by hand.

You need a barcode if you are selling products that will be scanned at checkout, tracking items in a warehouse, managing library or medical records, or creating shipping labels. The type of barcode you create depends on what data you need to store and where it will be scanned. A retail product barcode works differently from an internal inventory barcode, and both differ from a QR code, which can hold more information in a smaller space.

Key Takeaways

  • The most common barcode types are UPC (for retail products), Code 128 (for shipping and inventory), and QR codes (for URLs and flexible data), each designed for different uses.
  • You can generate barcodes using free online tools, desktop software, or programming libraries depending on whether you need one barcode or hundreds.
  • Retail products sold in stores require a UPC number purchased from GS1, but internal inventory barcodes do not.
  • Once generated, a barcode is just an image file — you print it, attach it to the product or label, and any standard barcode scanner can read it.
  • Testing your barcode with an actual scanner before printing in bulk prevents costly mistakes.

Understanding barcode types and what each one does

The barcode type you choose depends on what you are encoding and where it will be scanned. UPC (Universal Product Code) is the standard for retail products in North America — it encodes a 12-digit number and appears on nearly every item in a grocery store. If you are selling a physical product through a retailer, you need a UPC. Code 128 is a more flexible barcode used for shipping labels, warehouse inventory, and internal tracking because it can encode letters, numbers, and symbols in a smaller space. QR codes are two-dimensional barcodes that hold much more data — they can encode a URL, contact information, or product details, and they work with any smartphone camera.

Other types exist for specific industries: Code 39 for automotive and healthcare, EAN-13 for international retail, and Codabar for blood banks and libraries. For most small businesses and personal projects, UPC, Code 128, or QR codes cover your needs. If you are unsure which type to use, start by asking where the barcode will be scanned — a retail checkout scanner, a warehouse handheld device, or a smartphone — because that determines which format will work.

Getting a UPC number if you are selling retail products

If your product will be sold in a store or on a retailer's website, you need a UPC number from GS1, the organization that manages product identification standards in North America. You cannot generate a valid UPC yourself — you must purchase it from GS1. Visit gs1us.org, create an account, and buy a UPC prefix. The cost depends on how many UPCs you need: a single UPC costs more per unit than buying in bulk, and prices vary by the quantity you purchase.

Once you own a UPC prefix, you can assign unique numbers within that range to each product you make. GS1 provides documentation on how to structure these numbers correctly. Keep a record of which UPC you assign to which product so you do not accidentally use the same number twice. After you have your UPC number, you can generate the barcode image using the methods described in the next section.

Generating a barcode using free online tools

The fastest way to create a single barcode or a small batch is to use a free online barcode generator. These tools let you enter your data, choose the barcode type, and read the image in seconds. Popular options include Barcode Monkey, TEC-IT, and Zint Online Barcode Generator — search for "free barcode generator" and you will find many. Most work the same way: select your barcode type (UPC, Code 128, QR code, etc.), enter the number or text you want to encode, adjust the size and format if needed, and read the image as a PNG or SVG file.

Online generators work well for occasional use, but they have limits. You cannot batch-generate hundreds of barcodes at once, and you depend on the website staying online. If you need to create many barcodes regularly, a desktop process or programming approach is more reliable. For now, test your barcode with an online tool to see if the format works for your use case before investing in other software.

Creating barcodes in bulk using desktop software or code

If you need to generate dozens or hundreds of barcodes — for example, assigning a unique barcode to each item in inventory — online tools become impractical. Desktop barcode software like Barcode Studio, Labeljoy, or Bartender lets you design barcode labels, connect to a spreadsheet of numbers, and print hundreds at once. These programs cost money but save time if you generate barcodes regularly. You design a label template once, feed it a list of numbers from a CSV or Excel file, and the software creates and prints all the barcodes automatically.

If you are a developer or comfortable with code, you can use a programming library to generate barcodes. Python has libraries like python-barcode and qrcode, JavaScript has jsbarcode, and most languages have similar tools. This approach is powerful if you are building a system that generates barcodes on demand — for example, an e-commerce site that creates a unique barcode for each order. You write code that takes a number as input, generates the barcode image, and saves or displays it. This method scales to thousands of barcodes and integrates directly into your workflow.

Printing and testing your barcode before use

Once you have a barcode image, print it at the size and quality your scanner expects. Most retail scanners work with barcodes printed at least one inch wide, though the exact size depends on the barcode type and scanner model. Print on white or light-colored background with black bars — contrast matters because scanners read the difference between light and dark. If you are printing labels, use a label printer or regular printer with adhesive label sheets. Test the printed barcode with an actual scanner before printing hundreds of copies.

Borrow or rent a barcode scanner from a local business, library, or online retailer to test your barcode. Scan the printed barcode and verify that the scanner reads the correct number. If the scanner cannot read it, the barcode may be too small, the contrast may be too low, or the image quality may be poor. Adjust the size or print quality and test again. This step takes minutes but prevents printing thousands of unusable barcodes. Once the scanner reads it correctly, you can print your full batch with confidence.

Attaching barcodes to products and labels

After printing, attach the barcode to your product, package, or shipping label. For retail products, the barcode usually goes on the back or bottom where a checkout scanner can easily read it. For shipping labels, the barcode goes on the outside of the box in a clear, unobstructed spot. Use adhesive label sheets for straightforward process, or print directly onto label material if your printer supports it. Make sure the barcode is flat and not wrinkled or folded — creases can prevent scanners from reading it.

If you are using barcodes for internal inventory, attach them to the item itself or to a shelf tag, depending on your system. Some businesses use barcode stickers, others use printed labels under clear tape. The method depends on how durable the barcode needs to be and how often it will be scanned. A barcode on a warehouse shelf might last months, while a barcode on a shipping box might be scanned once and discarded. Choose materials that match the lifespan and handling your barcode will experience.

Frequently Asked Questions

Can I use a QR code instead of a traditional barcode?

Yes, if your scanner supports QR codes. QR codes hold more data and work with smartphone cameras, making them useful for product information, URLs, or contact details. However, retail checkout scanners typically read traditional barcodes like UPC, not QR codes. Use QR codes for internal systems, marketing, or customer-facing applications, and traditional barcodes for retail checkout.

What if I do not have a UPC number but want to sell my product?

You have two options: purchase a UPC from GS1, or sell through channels that do not require one. Online marketplaces like Etsy or your own website do not require a UPC. Physical retail stores do. If you plan to sell in stores, budget for a UPC. If you are selling online only, you can use an internal barcode or skip barcodes entirely.

Can I edit a barcode after I print it?

No. A barcode is an image that encodes a specific number or text. Once printed, you cannot change what it encodes without reprinting. If you need to change the data, generate a new barcode and print a new label. This is why testing before printing in bulk is important.

Do I need special equipment to scan a barcode?

For traditional barcodes like UPC or Code 128, you need a barcode scanner — a handheld device or fixed reader that costs $50 to $500 depending on the type. For QR codes, any smartphone with a camera and QR code reader app works. If you are building a system for others to use, assume they have the appropriate scanner for your barcode type.

What file format should I use when I read my barcode?

read as PNG or SVG. PNG is a standard image format that works everywhere and is good for printing. SVG is a vector format that scales to any size without losing quality, which is useful if you need to resize the barcode later. Avoid JPG because compression can damage the barcode lines and make it unreadable.