Barcode Generator - Free Online, PNG & SVG

Barcode Generator

Generate CODE128, EAN-13, UPC-A, and more. Download as PNG or SVG.

This free barcode generator creates scannable barcodes in eight formats, including CODE128, EAN-13, UPC-A, CODE39, EAN-8, ITF-14, MSI and Pharmacode. Enter a value, adjust bar width, height and colors, then download the result as a PNG or SVG for product labels, inventory tags, shipping sheets or documents.

What Is a Barcode and How Does It Work?

A barcode is a pattern of bars and spaces that represents a short string of numbers or characters in a form a scanner can read. The scanner sweeps light across the pattern, measures which parts reflect it and which absorb it, and converts the bar widths back into characters.

The code is only an identifier. A grocery barcode does not contain the price. The checkout system reads the number, looks it up in its own database, and returns the product and price. That is why one number should always point to one item.

Many formats end with a check digit, a final digit calculated from the others so a scanner can catch misreads. EAN-13, EAN-8, UPC-A and ITF-14 all use one, and this barcode maker adds it for you.

Which Barcode Format Should You Choose?

Pick the format based on where the barcode will be scanned, not on how it looks. Retail checkouts expect EAN or UPC, warehouses often use CODE128 or ITF-14, and internal labels can use almost any format.

FormatWhat you enterTypical use
CODE128Any ASCII text, 1 to 80 charactersShipping, assets, general labels
CODE39Letters, digits, space and - . / + % $ *, up to 43Industrial parts, ID badges
EAN-1312 digitsRetail outside North America
EAN-87 digitsVery small retail packages
UPC-A11 digitsRetail in the US and Canada
ITF-1413 digitsCartons and pallets
MSIDigits only, 1 to 30Inventory and shelf labels
PharmacodeA number from 3 to 131070Pharmaceutical packaging

What is barcode 128?

CODE128 is a compact format that can encode the full ASCII character set, which means letters, digits and punctuation in one barcode. That flexibility is why it is the default choice here and the safest pick when you are not bound by a retail standard.

How to Use the Barcode Generator

You can go from a blank form to a downloadable barcode in under a minute.

  1. Open Barcode Format and choose a format. A short note under the menu tells you exactly what that format accepts.
  2. Type your data into Value to Encode. The placeholder shows a 12-digit sample.
  3. Set Bar Width (a whole number from 1 to 5, default 2) and Height (px) (20 to 400, default 100).
  4. Choose a Bar Color and a Background. Black on white is the default and the most reliable.
  5. Leave Show text below barcode ticked if people need to read the number, or untick it for a bars-only image.
  6. Click Generate Barcode and check the preview.
  7. Click Download PNG for documents and web use, or Download SVG for print layouts that need sharp scaling.

Worked Example: Creating an EAN-13 and a UPC-A Barcode

For EAN-13 you enter 12 digits and the tool appends the 13th. Say you enter 590123412345.

  • Add the digits in odd positions: 5+0+2+4+2+4 = 17.
  • Add the digits in even positions and multiply by 3: (9+1+3+1+3+5) = 22, and 22 x 3 = 66.
  • Total: 17 + 66 = 83. The check digit is the amount needed to reach the next multiple of 10, which is 7.

The barcode therefore encodes 5901234123457, and that full 13-digit number appears beneath the bars. The same method works for UPC-A: enter 11 digits such as 03600029145 and the tool completes it with the check digit 2, giving 036000291452.

Notice that you never type the check digit yourself. If you enter 13 digits into an EAN-13 field, the tool will reject the value because it expects exactly 12.

How Do You Read and Fix the Results?

A good result is a clean preview with dark bars on a light background and the correct number printed below. If the tool shows an error message instead, the value does not match the rules of the chosen format.

Common messages and fixes

  • Enter a value to encode: the field is empty. Type your data and generate again.
  • Invalid value for the format: check the length and characters against the note under the format menu. EAN-13 needs exactly 12 digits, EAN-8 exactly 7, UPC-A exactly 11 and ITF-14 exactly 13.
  • Width or height message: bar width must be a whole number from 1 to 5 and height from 20 to 400.
  • Pharmacode rejected: use a number between 3 and 131070. Values of 1 or 2 are not valid.

Choosing size and color

A wider bar setting makes each bar thicker, so the barcode becomes wider and easier for cheap scanners to read. Heights around 80 to 120 px suit most labels. Keep strong contrast: dark bars on a light background scan best, while light bars on a dark background or two similar colors often fail.

Who Uses a Barcode Generator?

Anyone who needs a scannable code without buying label software can use it. Common situations include:

  • Small sellers labeling stock with CODE128 SKUs for their own tracking.
  • Warehouse teams printing ITF-14 codes for cartons and pallets or CODE39 tags for parts.
  • Office and IT staff tagging equipment, files and library items with asset numbers.
  • Designers who need a correct barcode graphic for a packaging mockup. Use the SVG so it stays sharp at any size, and the aspect ratio calculator can help you resize a PNG without distortion.
  • Spreadsheet and document users who want barcodes in Excel, Word or Google Sheets. Generate each code, download the PNG, and insert it as a picture.

CODE128 holds up to 80 characters, so short links fit well. If a web address is too long, shorten it first with the bulk URL shortener and encode the result.

Best Practices and Common Mistakes

Most scanning problems come from a few avoidable errors, so test before you print in bulk.

  • Scan a test print. Print one label at the real size and scan it with a phone app and, if possible, the scanner you will actually use.
  • Do not stretch the image. Resizing a PNG unevenly changes the bar proportions. Scale it evenly or use the SVG.
  • Avoid tiny barcodes. A bar width of 1 at a small print size can blur on low-resolution printers. Raise the width to 2 or 3.
  • Match the format to the system. A point-of-sale system set up for UPC will not accept a CODE39 label. Check what your scanner software expects.
  • Keep numbers unique. Reusing a value for two items makes your database lookups ambiguous.

Check digits are a separate idea from payment card checks, but if you are curious how another check-digit scheme works, the credit card validator demonstrates the Luhn method.

What Are the Limits of This Barcode Generator?

The tool creates one barcode at a time, so a large batch means repeating the steps for each value. It produces standard one-dimensional barcodes only, so it does not make QR codes.

A correctly formatted EAN-13 or UPC-A is not the same as an official product number. To sell through major retailers, you normally need a company prefix from GS1, and the tool cannot register numbers for you. For internal tracking, you can use CODE128 with your own numbering.

Barcodes shown inside payment or wallet apps, such as the codes used to add cash at a store, are created for your account by that app. A barcode made here will not work for those purposes.

The generator also does not look up products, so it will not tell you what an existing barcode belongs to.

Choose your format, enter your value and press Generate Barcode on this page. Within seconds you will have a PNG or SVG ready to print or drop into your document. For more helpers like this, browse the online calculators and utilities collection.

Frequently Asked Questions

How do I generate barcodes for free?
Choose a format, type your value, and click Generate Barcode. The tool is free and needs no sign-in. Then download the barcode as a PNG or SVG. You can adjust bar width, height and colors before downloading.
What is barcode 128 and when should I use it?
CODE128 is a compact barcode format that encodes any ASCII character, from 1 to 80 characters here. Use it for shipping labels, asset tags and internal SKUs, where you are not required to follow a retail standard like EAN or UPC.
Which barcode format should I use for products?
Use EAN-13 for retail outside North America and UPC-A for the US and Canada. Selling through major retailers normally requires numbers issued through GS1. For internal inventory, CODE128 works without that registration.
Why does the barcode generator say my value is invalid?
The value does not match the chosen format. EAN-13 needs exactly 12 digits, EAN-8 needs 7, UPC-A needs 11, ITF-14 needs 13, and Pharmacode must be a number from 3 to 131070. Do not type the check digit yourself, because the tool adds it.
How do I generate barcodes in Excel, Word or Google Sheets?
Create the barcode here, click Download PNG, then insert the image into your file as a picture. The tool makes one barcode per download, so repeat the steps for each value. Use the SVG when your layout program supports it.
Can I generate a barcode for Venmo or Cash App?
No. Barcodes used to add cash through apps like Venmo or Cash App are created inside the app for your account. A barcode made with this generator will not be recognized for those payments.
Recommended

Explore VPN options

A VPN changes your network exit. It does not guarantee anonymity.

Hide Your IP Encryption Network coverage
Protect My IP Now