πŸ“Š Barcode Generator

Code 39, Code 128-B, and EAN-13 barcodes with PNG download, built entirely in your browser.

What Is a Barcode?

A barcode is just data drawn as bars. A scanner reads the widths and spacing of the bars, decodes them back into characters, and looks the value up in a database. The three formats this tool generates cover the vast majority of real-world barcode needs. Code 39 is the classic alphanumeric barcode seen on ID badges, library books, and inventory labels. Code 128 is its denser modern cousin, used in shipping labels (it is the format behind most UPS and FedEx tracking numbers), healthcare, and logistics. EAN-13 is the 13-digit retail barcode printed on nearly every product sold outside North America, and its US equivalent UPC-A is nearly identical. Each format has its own rules for which characters it can encode and how it validates the data, and this generator follows the published encoding tables for all three.

The Three Formats, Compared

Code 39Uppercase letters, digits, - . space $ / + %. Wide bars, very forgiving scanners. Best for internal labels, badges, and asset tags.
Code 128-BFull printable ASCII. Compact and dense with a mandatory checksum. Best for shipping labels, SKUs, and anywhere space is tight.
EAN-13Exactly 12 digits plus an auto-calculated check digit. Best for retail products sold internationally. Needs a real GS1 number for stores.

When to Use Each Format

Use Code 39 when the barcode lives in a rough environment: warehouse bins, tool check-out tags, and conference badges, where an older or low-quality scanner might be used. Its wide bars and simple pattern make it the most forgiving format to print and scan. Use Code 128 when you need more data in less space: carton labels, serial numbers, order numbers, and shipping labels, where the mandatory checksum also gives you an extra layer of data integrity. Use EAN-13 only for retail products, and only with a genuine GTIN you registered with GS1. A random 13-digit number will encode and scan just fine, but no retailer or marketplace will accept it, because the number has to be globally unique to your product.

One common mistake is using a retail format for internal tracking. If the barcode never leaves your building, Code 39 or Code 128 is simpler and gives you readable letters and SKUs instead of bare digits. The human-readable text printed under the bars should always match exactly what is encoded, so a person can type it in when the scanner fails.

Printing Tips for Barcodes That Scan

Contrast is everything. Print black bars on white (or very light) paper, never reversed, and never over a colored background or pattern. Print at 300 DPI or higher: inkjet at draft quality produces fuzzy bar edges that confuse scanners. Never shrink a barcode below 80 percent of its generated size, and keep the quiet zone, the blank space on both sides, at least as wide as the tool renders it. Laminating is fine as long as the surface is matte: glossy lamination creates glare that kills scans. Finally, always test with the actual scanner you will use in production, not just your phone camera. Scan from the printed copy, at the distance you will really use, before you print a thousand labels.

Technical note: Code 39 uses the standard narrow/wide bar table with start/stop asterisks. Code 128-B uses the published 11-module pattern table with Start B, a mod-103 checksum, and the stop pattern. EAN-13 uses the standard L/G/R parity tables with guard bars and a calculated check digit.

Frequently Asked Questions

Which barcode format should I use for retail products?

Retail products in the US use UPC-A and internationally EAN-13. If you are selling through stores, Amazon, or major marketplaces, you need a genuine registered GTIN from GS1, not a random number. For internal use like warehouse bins, asset tags, and event tickets, Code 39 or Code 128 are the common choices.

What is the difference between Code 39 and Code 128?

Code 39 is older and simpler, with a small character set (uppercase letters, digits, and a few symbols) and wide spacing, which makes it forgiving to print and scan. Code 128 packs the same data into a much narrower barcode and supports the full ASCII range, so it is the better pick when space is tight.

Will these barcodes actually scan?

They are built from the real published encoding tables for each symbology, with correct start/stop patterns and checksums where the format requires one. They will scan as long as you print them at a readable size (at least 1 inch wide for Code 39), on a light background, with clean contrast. Test every barcode with your actual scanner before a big print run.

Why does Code 39 not support lowercase letters?

The Code 39 standard only defines uppercase letters, digits 0-9, and the symbols - . space $ / + %. The generator automatically uppercases your input. If you need lowercase or mixed case, use Code 128-B, which encodes the full printable ASCII range.

Do I need a check digit?

EAN-13 requires a check digit and this generator calculates it for you from the 12 digits you enter. Code 39 has an optional mod-43 check digit that most real-world uses skip. Code 128 always includes a mandatory mod-103 checksum, which the generator computes automatically.

What size should I print a barcode?

As a rule of thumb, never shrink a barcode below 80 percent of its nominal size. For Code 39 and Code 128, aim for at least 1 to 1.5 inches wide at 300 DPI. EAN-13 should be at least 80 percent of the standard 37 x 26 mm size. Always leave quiet zones (blank space) on both sides.