This tool lets you create UPC-A, EAN-13, and Code-128 barcodes directly in your browser. You can enter the data you want to encode, choose the barcode symbology, generate a scannable image, and download it as a PNG for printing on product labels, inventory stickers, or shipping documents. All processing happens locally in your browser for speed and privacy.
Use the quick steps below to generate a barcode:
A barcode is a machine-readable representation of information. For linear barcodes like UPC-A, EAN-13, and Code-128, the pattern of dark bars and light spaces encodes digits or characters. A scanner reads the widths and positions of those elements, then converts them back into the original data.
Each barcode type (also called a symbology) follows strict rules about how data is encoded, how long it can be, and which characters are allowed:
The barcodes generated by this tool are intended for testing, internal labeling, and educational or workflow use. They follow the mathematical encoding rules of each symbology, but they do not automatically provide you with officially registered numbers from GS1 or other authorities.
To avoid invalid barcodes or scanner errors, it is important to follow the length and character rules of each symbology. The sections below outline the key rules and show how check digits are calculated conceptually.
Allowed characters: digits 0–9 only
Length: exactly 12 digits (including the check digit at the end)
UPC-A uses a single check digit at the end of the number to help detect common errors. The check digit is computed from the first 11 digits. In simplified form, the calculation can be expressed as:
Where SumOdd is the sum of the digits in odd positions (1st, 3rd, 5th, etc.) from the left, and SumEven is the sum of the digits in even positions (2nd, 4th, 6th, etc.), both excluding the check digit itself.
Depending on how your implementation is configured, the tool may either:
If you enter too few or too many digits, or if you include non-numeric characters, the generator will either reject the input or produce a warning, depending on how validation is handled in the interface.
Allowed characters: digits 0–9 only
Length: exactly 13 digits (including the check digit at the end)
EAN-13 is similar to UPC-A but longer, with an additional digit and slightly different weighting in the check digit calculation. Conceptually, the check digit is computed from the first 12 digits by weighting alternate digits by 1 and 3 and then taking the result mod 10.
Typical behavior for EAN-13 input in generators is one of the following:
Non-numeric characters or the wrong length will result in invalid barcodes and should be corrected before use in production or printed materials.
Allowed characters: typically the full 7-bit ASCII range (including digits, letters, spaces, and many punctuation symbols). Some implementations may restrict this slightly for simplicity.
Length: variable, with a practical maximum based on readability and scanner capabilities. Longer data strings create physically wider barcodes.
Code-128 uses internal start codes, character sets (A, B, and C), and a modulo-103 check character. The generator handles the internal encoding details, so you only need to provide the text or numbers to encode. However, keep in mind:
If you are not sure which barcode type to use, consider where and how the barcode will be scanned. Retail point-of-sale systems often expect UPC or EAN, whereas internal logistics systems frequently use Code-128 for flexibility.
Use this as a general guide:
| Format | Allowed characters | Typical length | Common use cases | Notes |
|---|---|---|---|---|
| UPC-A | Digits 0–9 only | 12 digits (fixed) | Retail products in North America; supermarket items; packaged goods | Requires GS1-assigned company prefix for official retail usage |
| EAN-13 | Digits 0–9 only | 13 digits (fixed) | Global retail products; books (alongside ISBN); consumer goods | Includes a country/GS1 prefix; widely recognized in international commerce |
| Code-128 | ASCII (numbers, letters, punctuation) | Variable (practical upper limit depends on label size) | Inventory labels; shipping cartons; internal asset tags; warehouse shelves | High data density; supports both numbers and letters in a single barcode |
This example walks through creating a simple test barcode and checking that it behaves as expected when scanned.
03600029145 (11 digits) if the implementation auto-calculates check digits, or 036000291452 (12 digits) if it expects the full UPC-A including the check digit.RACK-A3-BIN-07 into the Data to encode field.RACK-A3-BIN-07.When you generate a barcode with this tool, you are seeing a visual encoding of your input data. Keep the following in mind when reviewing and using the results:
If a scanner cannot read the barcode, the most common remedies are increasing the size of the printed barcode, ensuring higher print quality, or shortening the encoded data (especially for Code-128).
This barcode generator is designed for convenience and learning, not for replacing official registration processes. Be aware of the following limitations and assumptions:
Unlike many online barcode services, this tool performs all calculations directly in your browser using client-side code. This has several implications:
If you are subject to strict data handling policies, you should still verify that your browser, network, and any plugins meet your organization’s security requirements.
To get the best results from the barcodes you generate:
By following these guidelines and the input rules above, you can use this barcode generator as a reliable part of your labeling and tracking workflows.
You can use the generated images for prototypes, internal testing, and some limited use cases. However, for products sold through major retailers, your numbers must usually come from GS1 or an authorized numbering authority to avoid conflicts with other manufacturers.
The check digits are produced according to the standard mathematical rules of each symbology. As long as you provide valid input (correct length and characters), the generated check digits will be mathematically correct. Always verify with a scanner before deploying in production.
From a technical standpoint, you can print and use the PNG images in your own business for internal labels, packaging tests, and similar tasks. Legal rights to use specific numbers (for example, a UPC that belongs to another company) are separate from the image generation itself and must be respected.
Common reasons include poor print quality, a barcode that is too small, insufficient contrast, damage to the printed label, or using an incorrect symbology for your system. Verify the data, increase the print size, and ensure you are using the expected format (UPC-A, EAN-13, or Code-128).
The generator is designed to run entirely in your browser using client-side code, so it does not need to send your barcode content to a server. Nevertheless, always review your organization’s security guidelines when handling sensitive identifiers.