Barcode Generator
Generate a barcode in CODE128, EAN-13, UPC, or CODE39 format.
How to Use
Pick a barcode format from the dropdown, then type the value to encode. The preview above updates live, if the value doesn't match the format's required pattern (like EAN-13 needing 12 or 13 digits), an error message explains exactly what's expected instead of silently failing. Click Download PNG to save the barcode as an image, complete with the human-readable digits printed beneath the bars, ready to drop into a label template or document. The default example, CODE128 encoding "CALC369123", demonstrates that this format can freely mix letters and numbers, something the numeric-only retail formats can't do.
What Each Barcode Format Is Actually For
CODE128 is the most flexible format here, capable of encoding any combination of letters, numbers, and most punctuation, and its variable length makes it a common choice for shipping labels, inventory tags, and internal tracking numbers where the value isn't dictated by an outside retail standard. EAN-13 (European Article Number) is the standard found on the vast majority of retail products sold internationally, especially across Europe and Asia, always exactly 13 digits. UPC-A (Universal Product Code) is EAN-13's North American counterpart, functionally similar but always exactly 12 digits, and is what you'll find on most products sold in the United States and Canada. CODE39 is an older alphanumeric format, less data-dense than CODE128 but still widely supported by legacy scanning hardware, commonly seen on ID badges, some automotive parts, and older logistics systems.
How Barcodes Encode Data
Every barcode format works by translating each character into a specific sequence of black bars and white spaces of varying widths, a scanner's laser or camera sensor reads the pattern of light and dark as it passes across the code and reconstructs the original characters from the timing of those transitions. The three numeric retail formats (EAN-13, UPC-A, and their relatives) also always end in a check digit, a single digit mathematically calculated from all the digits before it. When a scanner reads the code, it redoes that same calculation and compares the result to the check digit actually encoded, if they don't match, the scanner knows the read was corrupted (from a smudge, a printing defect, or a misalignment) and rejects it rather than passing bad data through, which is why check digits matter even though they don't carry any product information themselves.
Choosing the Right Format for Your Use Case
If you're labeling something for internal use only, inventory bins, equipment asset tags, internal shipment tracking, sample kits, CODE128 is usually the most practical choice since it handles any text you want without needing to conform to a numeric retail standard. If you're preparing a barcode for an actual retail product that will scan at a real store's point-of-sale system, you need EAN-13 or UPC-A with a number officially licensed through GS1, see the FAQ below for why a self-assigned number isn't appropriate there. CODE39 is worth reaching for specifically when you know your target scanning hardware or software is older or specifically expects that format, otherwise CODE128 generally handles the same use cases more efficiently.
Common Use Cases
Beyond retail packaging, barcodes show up constantly in warehouse and inventory management, tracking a bin, shelf, or item with a scannable code that's faster and more reliable to look up than typing an ID by hand. Shipping and logistics companies rely heavily on CODE128 for tracking numbers precisely because of its flexible alphanumeric encoding. Libraries use barcodes (often CODE39 or CODE128) on book spines and library cards for fast checkout scanning, and event organizers use them on tickets and badges for quick check-in scanning at the door. This tool is also handy for anyone building a mockup, prototype, or documentation example that needs a realistic-looking barcode without needing to source one from an actual product.
Common Mistakes
Entering letters into the EAN-13 or UPC-A fields and being confused by the resulting error is a common early stumble, both formats are strictly numeric-only by specification, unlike CODE128 or CODE39 which happily accept letters. Assuming a self-generated EAN-13/UPC number is safe to put into production for a real product sold in stores is a bigger, easier-to-miss mistake, covered in the FAQ below, since an unregistered number risks colliding with another company's actual GS1-licensed code once it reaches a retail scanning system. Printing a barcode too small is another practical pitfall that has nothing to do with this tool specifically, every symbology has a minimum reliable bar width for a given scanner's resolution, shrinking a barcode image down too far for a tiny label can make it unreadable even though it displays perfectly fine on a screen.
Frequently Asked Questions
Which barcode format should I use?
CODE128 accepts any letters, numbers, and symbols and is common in shipping and inventory. EAN-13 and UPC are the standard formats for retail products in Europe and North America respectively, and require specific digit counts. CODE39 accepts letters and numbers and is common in logistics and ID badges.
Will this barcode scan with a real scanner?
Yes, this generates a standards-compliant barcode image using the same underlying symbology any commercial barcode scanner or scanning app expects, it isn't a stylized approximation.
Can I use this to create a real UPC barcode for a product I want to sell in stores?
This tool generates a technically valid, scannable UPC-A or EAN-13 barcode from any number you provide, but for a product actually sold at retail, the number itself needs to be a globally unique identifier officially licensed from GS1 (the organization that administers these numbering systems), not just any 11 or 12 digits you make up. A made-up number will scan and display correctly, but it could collide with another company's real registered product code once it reaches an actual retail point-of-sale system, which is why real commercial products go through GS1's registration process rather than generating a number independently.
Why does my EAN-13 or UPC value need a specific number of digits?
Both formats are fixed-length standards, EAN-13 always encodes 13 digits and UPC-A always encodes 12, with the very last digit being a checksum calculated from all the digits before it. This tool accepts either the full length (13 or 12) if you already have a check digit, or one digit short (12 or 11) and calculates the correct check digit for you automatically, which is why the format dropdown lists both digit counts as valid.
What is the checksum digit for, and why does it matter?
The checksum digit is calculated from all the other digits using a fixed formula, and a scanner recalculates that same formula after reading a barcode to confirm the result matches. If a barcode is printed poorly, partially smudged, or misread due to a scanning glitch, a mismatched checksum tells the scanner something went wrong rather than silently accepting corrupted data, similar in spirit to how a credit card number's final digit catches typos. It's a built-in error-detection feature of the barcode standard itself, not something specific to this tool.
Is my barcode data sent anywhere when I generate one?
No. The barcode is rendered entirely in your browser using the open-source JsBarcode library loaded from a CDN, the value you type is never transmitted to a server, it only exists in your browser tab and inside the downloaded image once you save it.