Barcode Generator

Create scannable barcodes from any text or number — CODE128, EAN-13, UPC-A, Code 39, ITF-14, MSI or Pharmacode — and download a PNG. No signup.

Remove Ads

This free online barcode generator turns any text or number into a scannable barcode, right in your browser. Type your code, pick one of seven formats — CODE128, EAN-13, UPC-A, Code 39, ITF-14, MSI or Pharmacode — and the barcode draws instantly. Download it as a PNG and print it on a label or package. No account, no app, and no install required on any device.

On this page

  1. How to Generate a Barcode Step by Step
  2. What Barcodes Are and How They Encode Data
  3. Barcodes Versus QR Codes for Your Data
  4. Who Uses a Barcode Generator
  5. Pro Tips for Scannable Barcodes
  6. Common Barcode Mistakes to Avoid
  7. Related Tools You May Need Next
  8. Frequently Asked Questions

How to Generate a Barcode Step by Step

  1. Enter your data. Type the text or number you want the barcode to represent — a product code, an SKU, an asset ID or a reference number — into the input field. The barcode draws live as you type; there is no Generate button to press. The field opens with the example value 123456789012.
  2. Choose a barcode format. Select the barcode type that suits your use. Some formats accept only numbers, others accept letters and numbers, and different formats are standard in different industries. The format rules are in the table below — pick one that accepts your characters.
  3. Pick a line colour if you want one. The bars are black by default. Use the colour picker to change them, keeping the contrast against the background high so scanners can still read the code.
  4. Check it scans. Before relying on it, scan the barcode with a phone or a scanner to confirm it reads back the correct data. A barcode that looks fine may not scan if the data or format is wrong.
  5. Download the image. Press Download PNG to save the barcode as a PNG file, named barcode.png, on a white background — ready to place on a label, print onto packaging, or add to a document.

Worked example: the default value, then EAN-13 and UPC-A

The tool opens with 123456789012 and CODE128 selected, so a barcode is already on screen. Switch the format to EAN-13 and the same 12 digits stay — the tool adds the check digit itself, so the printed value reads 1234567890128 (the check digit is 8). Try 590123412345 as EAN-13 and it becomes 5901234123457. Switch to UPC-A and type 03600029145 — 11 digits — and the tool completes it to 036000291452. If you type a value the format cannot hold, for example letters with EAN-13 selected, a red message appears: “Invalid value for EAN13. Check the format requirements.”

ControlWhat it doesDefault
Text or number to encodeThe data the barcode represents123456789012
Barcode typeOne of 7 formats (see table below)CODE128
Line colorColour of the barsBlack (#000000)
Barcode previewDraws live as you type, with the value printed underneathFixed size: bar width 2, height 90
Download PNGSaves the barcode as barcode.png on a white backgroundPNG only
FormatWhat it acceptsTypical use
CODE128Any ASCII text — letters, digits, symbolsShipping, inventory, asset tracking
EAN-1312 digits (check digit added) or 13 digits with the correct check digitRetail products worldwide
UPC-A11 digits (check digit added) or 12 digits with the correct check digitRetail products, mainly North America
CODE39Capital letters A–Z (lowercase is converted to capitals), digits, and - . space $ / + %Logistics, ID cards, asset labels
ITF-1413 digits (check digit added) or 14 digits with the correct check digitShipping cartons and cases
MSIDigits only, any lengthInventory and warehouse bins
PharmacodeA whole number from 3 to 131070Pharmaceutical packaging

Barcode generator interface with a form, a barcode preview and a scanner

What Barcodes Are and How They Encode Data

A barcode is a machine-readable representation of data, encoding text or numbers as a pattern of parallel bars and spaces of varying widths. The first barcode was patented in 1952, but barcodes only became ubiquitous in the 1970s when the Universal Product Code, the familiar UPC on retail products, was standardised and adopted by supermarkets. A scanner reads the pattern of light and dark and decodes it back into the original data almost instantly.

There are many barcode formats, called symbologies, each with different rules and uses. Some, like UPC and EAN, are numeric only and used for retail products worldwide. Others, like Code 128 and Code 39, accept letters and numbers and are common for shipping, inventory and asset tracking. Choosing the right format matters, because the wrong one may not accept your data or may not be recognised by the scanners in your industry.

The barcode is a key, not a container. A barcode holds a short code, not full information. It works as a lookup key: the scanner reads the code and a database provides the details. This is why barcodes are small and reliable. If you need to embed more data directly, a QR code holds far more than a linear barcode.

Most numeric formats end in a check digit — a final digit calculated from the others that lets a scanner catch a misread. This tool adds the check digit for you when you enter the shorter form: 12 digits for EAN-13, 11 digits for UPC-A, 13 digits for ITF-14. If you enter the full-length number instead, its last digit must already be the correct check digit, or the tool shows an error instead of drawing a barcode.

Barcodes Versus QR Codes for Your Data

AspectLinear barcodeQR code
Data capacitySmall, a short code or numberLarge, URLs, text, contact details
ShapeBars and spaces in a lineA square grid of dots
Typical useRetail products, inventory, shippingMarketing links, tickets, payments
ScanningDedicated scanners and phonesPhone cameras
Check digitBuilt into EAN, UPC and ITF-14Built-in error correction instead
Best forA code that looks up details in a systemEmbedding data or a link directly

Who Uses a Barcode Generator

Retailers and shops. A shop generates barcodes for products or SKUs so items can be scanned at the till and tracked in stock, replacing manual code entry.

Warehouse and inventory managers. Someone managing inventory creates barcodes for shelves, bins or items so stock can be counted and located quickly with a scanner.

Asset trackers. An organisation labels equipment, tools or IT assets with barcodes so each item can be scanned to log its location, owner or maintenance.

Small businesses and makers. A small seller generates barcodes for their products to meet a marketplace requirement or to run their own simple point-of-sale system.

Event and library organisers. Someone managing tickets, memberships or a library collection uses barcodes on cards or items for fast check-in and lending.

Laptop on a desk showing a barcode generator with a barcode preview and a label printer

Pro Tips for Scannable Barcodes

Match the format to your industry. Retail products usually need UPC or EAN, while shipping and internal tracking often use Code 128 or Code 39. Using the format your scanners and systems expect is essential for the barcode to be recognised.

Let the tool add the check digit. Enter 12 digits for EAN-13, 11 for UPC-A or 13 for ITF-14 and the final digit is calculated for you. Entering a full-length number with a wrong last digit only produces an error.

Test-scan before printing a batch. Always scan the generated barcode to confirm it reads the correct data before printing hundreds of labels. A format or data error caught now saves a costly reprint later.

Keep the barcode large enough. The tool draws at a fixed size, with a clear margin around the bars. If you scale the downloaded PNG up for printing, test-scan it again at the actual print size.

Use CODE128 for letters. If your data includes letters, choose CODE128 — numeric formats reject letters, and Code 39 turns lowercase letters into capitals, so mixed-case text loses its case.

Rename each download. Every download is saved as barcode.png, so rename the file after each download or the next one will overwrite it.

Print on a plain, high-contrast background. Barcodes scan best as dark bars on a light background. Avoid printing over patterns or in low-contrast colours, which can defeat the scanner.

Common Barcode Mistakes to Avoid

Choosing a format that rejects your data. Numeric-only formats like UPC and EAN cannot encode letters. If your code contains letters, pick CODE128 instead.

Expecting lowercase letters to stay lowercase in Code 39. The tool converts lowercase letters to capitals automatically — type abc and the printed value reads ABC. If the case of your text matters, use CODE128 instead.

Entering a wrong check digit. A full-length EAN-13, UPC-A or ITF-14 number with an incorrect final digit is rejected. Enter the shorter form and let the tool add the check digit.

Printing the barcode too small to scan. A barcode shrunk to fit a tiny label may become unscannable. Keep it at a readable size with a clear margin around it, and test-scan at the actual print size before committing to a batch.

Skipping the test scan. Assuming a barcode works because it looks right is risky. Always scan it to confirm it decodes to the correct data, since an unnoticed error propagates across every label you print.

Expecting a size setting. This tool has no width or height control — the bars are always drawn at the same size. Scale the downloaded PNG if you need it bigger, then test-scan the scaled version.

Expecting a JPG, SVG or QR code. The only download is a PNG, and the tool makes linear barcodes only. For a QR code, use a QR generator instead.

Using the wrong format for your scanners. If your industry or equipment expects a particular symbology, a barcode in a different format may not be recognised even if it is technically valid.

Related Tools You May Need Next

QR Code Generator — encode a link, text or contact details in a square QR code when a linear barcode cannot hold enough data. QR Code Scanner — read a QR code back with your camera to check what it contains. Random String Generator — create unique codes and identifiers to encode as barcodes. Random Number Generator — pick random numbers for SKUs, tickets or asset IDs. Password Generator — make strong random passwords for the systems your barcodes feed into. Image Resizer — resize a downloaded barcode PNG to fit a label exactly. Case Converter — change text between upper, lower and title case. Word Counter — check the length of the text you plan to encode.

Barcode printing and scanning machine with a barcode on a conveyor belt

Frequently Asked Questions

How do I generate a barcode?

Enter the text or number you want to encode, choose the barcode format that suits your use, and the barcode draws instantly — there is no Generate button. Press Download PNG to save it. Before printing in quantity, scan the barcode with a phone or scanner to confirm it reads back your exact data.

What barcode format should I use?

It depends on your data and industry. Retail products typically use UPC or EAN, which are numeric only. Shipping, inventory and asset tracking often use Code 128 or Code 39, which accept letters and numbers. Choose the format your scanners and systems expect, and make sure it accepts the kind of data you have.

How many digits does an EAN-13 barcode need?

Twelve or thirteen. Enter 12 digits and the tool adds the check digit for you — for example, 590123412345 becomes 5901234123457. Enter 13 digits and the last one must already be the correct check digit, or the tool shows an error.

How many digits does a UPC-A barcode need?

Eleven or twelve. Enter 11 digits and the tool adds the check digit — for example, 03600029145 becomes 036000291452. Enter 12 digits and the last one must already be the correct check digit.

Can a barcode contain letters as well as numbers?

Some formats can and some cannot. Numeric-only formats like UPC, EAN and ITF-14 accept digits alone, while CODE128 accepts any ASCII text and Code 39 accepts capital letters, digits and a few symbols. If your data includes letters, choose CODE128.

What file do I get when I download?

A PNG image named barcode.png, with the barcode on a white background and the value printed underneath the bars. There is no JPG or SVG download, so rename the file after each download to avoid overwriting the previous one.

Can I change the size of the barcode?

Not in the tool — the bars are always drawn at the same fixed size. You can scale the downloaded PNG in an image editor or with an image resizer, but test-scan the scaled version at its real print size before using it.

Why does my barcode show an error message?

The value does not fit the format you picked: letters with a numeric-only format, a number outside 3–131070 for Pharmacode, or a full-length EAN, UPC or ITF number whose final check digit is wrong. The red message names the format — check the format rules table and correct the value.

Is the barcode generator free?

Yes, it is completely free with no account and no usage limit. You can generate as many barcodes as you like, in the seven supported formats, as often as you like, at no cost. It runs entirely in your browser on any device, so there is nothing to download or install.

Do I need special software to scan the barcode?

No special software is needed to generate it here, and to scan it you can use a dedicated barcode scanner or, for many formats, a smartphone camera or scanning app. The barcode image you download can be printed on labels or packaging or added to documents.

Remove Ads