Introduction to UPC-A, EAN-13, and Code-128 barcode generation
This barcode generator draws linear UPC-A, EAN-13, and Code-128 symbols from data you enter. Choose the symbology that suits the label, type the value to encode, and the page creates a browser-based preview. It is intended for quickly preparing barcode artwork for internal labels, packaging mockups, software tests, inventory work, and similar jobs where you need to see the encoded symbol before printing it.
Barcode generation is especially useful when a workflow needs a scannable representation of an existing identifier. A warehouse can encode a rack, bin, carton, or asset reference with Code-128. A product team can place a supplied retail number into a UPC-A or EAN-13 mockup. The preview shows the bars and the human-readable value, while the status message indicates whether the current entry has the character count required by the selected format and whether the image is ready to copy or download.
This page handles barcode encoding, not identifier assignment. It does not issue GS1 company prefixes, establish ownership of a retail number, or determine whether a retailer will accept a label. For UPC-A and EAN-13, it renders the complete number provided when it has the required length; it does not calculate or validate the final check digit. That makes separate number verification and a scan test important before using a retail label outside a prototype or internal process.
How to use the barcode generator
To generate a barcode, enter the value in the first field and select its barcode type in the second field. UPC-A accepts exactly 12 digits and EAN-13 accepts exactly 13 digits. Code-128 on this page supports printable ASCII text, so it can represent letters, numbers, spaces, and common punctuation used in location codes, stock references, and shipment labels. The preview refreshes as you type or change the format.
The barcode workflow is direct: enter the data, select the symbology, inspect the preview, and then use the available action buttons. Copy Data places the text value on the clipboard; Download PNG saves the rendered preview as an image for use in a document or print workflow. If a retail entry is rejected, correct its length or non-numeric characters. If Code-128 is rejected, remove characters outside the printable ASCII range supported by this page.
- Type the label value or identifier to encode.
- Select UPC-A, EAN-13, or Code-128.
- Inspect the barcode preview and readiness message.
- Copy the encoded text when another system needs the same value.
- Download the PNG after confirming the preview is appropriate.
Choose a barcode type based on the scanner and system that will receive the label. UPC-A is used on many North American retail products, while EAN-13 is widely used for retail identification internationally. Code-128 is a flexible operational format for mixed-text labels such as inventory locations, cartons, assets, and internal tracking references. A scanner configuration or downstream application may expect one specific symbology, so matching the established workflow matters more than choosing the most flexible format.
How barcode formats, lengths, and supplied check digits work
Barcode symbols encode data according to defined patterns of bars and spaces. Each supported format has its own character rules, start and stop patterns, and physical layout. UPC-A and EAN-13 are fixed-length numeric retail symbols, whereas Code-128 can carry a variable-length string of printable characters. These structural differences explain why a value that is suitable for a warehouse bin label may not be suitable for a retail product symbol.
UPC-A contains 12 digits total, and EAN-13 contains 13 digits total. In each retail format, the final digit is normally a check digit derived from the earlier digits by the applicable standard. This generator expects the complete retail value, including that final digit. It checks the numeric character requirement and total length before drawing the symbol, but it does not independently determine whether the supplied final digit agrees with the preceding digits. Use a trusted source or separate checksum validation when the number will be used as a retail identifier.
Code-128 works differently from the fixed retail formats. The page encodes supported printable text using Code Set B, which covers ordinary ASCII letters, digits, spaces, and punctuation. The Code-128 encoder calculates its internal checksum codeword from the start code and the position-weighted data codewords before adding the stop pattern:
Here, 104 is the Code Set B start code, is the codeword for the character in position , and the resulting checksum is followed by the Code-128 stop code. This is useful for values such as RACK-A3-BIN-07, but a longer source string produces a wider barcode. When space is limited, keep internal identifiers concise enough to preserve a readable bar width after printing.
The supported barcode formats differ in the data they accept and the jobs for which they are commonly chosen. Use the comparison below as a practical selection guide, then confirm the expected format with the system that will scan the label.
Comparison of supported barcode formats
| Format |
Allowed content |
Typical length |
Common use |
What to watch for |
| UPC-A |
Digits 0-9 only |
12 digits fixed |
North American retail products |
Supply all 12 digits, including a separately verified check digit |
| EAN-13 |
Digits 0-9 only |
13 digits fixed |
International retail products |
Supply all 13 digits, including a separately verified final digit |
| Code-128 |
Printable text, numbers, and punctuation |
Variable |
Inventory, logistics, bins, cartons, internal labels |
Very long strings can print too wide for small labels |
For a product number already governed by a retail standard, use the matching retail symbology and confirm the number with the organization that assigned it. For internal codes containing letters, hyphens, slashes, or mixed content, Code-128 is generally the practical choice among the formats available here. In either case, print and scan a sample at its final size before producing a larger batch: a symbol can look clean on screen yet become difficult to read when reduced, distorted, or printed on a poor surface.
Barcode generation examples and result interpretation
A warehouse location such as RACK-A3-BIN-07 is a straightforward Code-128 example because it combines letters, digits, and hyphens. Enter that value, select Code-128, and the preview will display the encoded bars with the same text beneath them. A successful scanner test should return exactly the source string. If it does not, examine the printed output, scaling, contrast, and scanner settings before changing the underlying location code.
For a retail-style label, enter the full identifier supplied by the relevant numbering process. For example, 036000291452 has the 12-digit length required for UPC-A, and 5901234123457 has the 13-digit length required for EAN-13. The generator can render those values because they meet the format-length rules. Length acceptance is not a claim that a retail number is assigned, unique, or checksum-valid, so verify those matters separately when they affect the intended use.
- For a UPC-A preview, enter a complete 12-digit UPC-A value and select UPC-A.
- For an EAN-13 preview, enter a complete 13-digit EAN value and select EAN-13.
- For an internal label, enter
RACK-A3-BIN-07 and select Code-128.
When reviewing a generated barcode, do more than confirm that bars appear. Check that the human-readable text matches the intended source value character for character and that the selected symbology suits the receiving system. Leave clear white space around the symbol, often called a quiet zone, so the scanner can identify its boundaries. For Code-128 in particular, avoid squeezing a long identifier into a small label; reducing the bar width too far can make a technically correct symbol impractical to scan.
Printing, scanning, assumptions, and barcode limits
Barcode printing quality has as much influence on scan success as the encoded data. High contrast between dark bars and a light background is the conventional safe choice. A barcode that appears sharp on a monitor can lose definition when it is reduced, stretched, compressed, or printed by a low-quality device. Test the actual label stock, printer, and scanner combination whenever the code will support an operational process.
This barcode generator remains intentionally focused on rendering a symbol from supplied data. It does not register numbers with GS1, connect to a point-of-sale system, maintain an inventory database, or decide whether two internal labels duplicate one another. Manage identifier ownership, uniqueness, and system integration outside the tool. That separation is suitable for mockups and local workflows, while retail distribution and controlled labeling processes may require additional validation and governance.
The encoding runs in the browser, so producing a barcode does not require posting the entered value to a server. This can be convenient for internal identifiers, temporary shipment references, shelf maps, and similar operational text. Local generation does not eliminate every privacy consideration: downloaded PNG files, browser history or extensions, printer queues, and storage locations may still be governed by your organization’s handling rules.
The page assumes exact numeric lengths for UPC-A and EAN-13 and printable ASCII text for its Code-128 implementation. It does not verify retail check digits even when a value has the proper length. If a printed label fails to scan, first confirm the source data and selected symbology, then check the final print size, contrast, quiet space, and scanner compatibility. Most barcode problems are traceable to data, format selection, or physical print conditions rather than the visible pattern alone.
Frequently asked questions about generated barcodes
Can I use these barcodes on products sold in retail stores? The generated images are useful for prototypes, internal testing, and limited operational labeling. Products entering major retail channels generally need identifiers assigned through GS1 or another authorized numbering source so they do not conflict with another company’s codes.
Does this generator calculate or verify retail check digits? No. For UPC-A and EAN-13, this page checks that the entry contains the required number of digits and renders the full value supplied. It does not calculate, replace, or verify the final check digit, so verify retail numbers separately and test a printed label with the intended scanner.
Can I use the generated images commercially? You can technically print the downloaded PNG images for business documents, labels, and internal systems. Whether you are entitled to use a particular encoded number is a separate issue, especially for retail identifiers assigned to another organization.
Why will my scanner not read a barcode I printed? Typical causes include inadequate contrast, a symbol printed too small, scaling or label damage, insufficient clear space around the bars, or a barcode type that the receiving system does not expect. Check the data and format, print at a larger final size, and test the finished label with the scanner in use.
Does this tool store or log my barcode data? Generation runs in the browser and does not require sending barcode content to a server. Review downloaded files, browser settings, and your local printing workflow separately when the identifiers are sensitive.
Enter data and choose a format to preview a barcode.