Barcode Generator
Create EAN-13, UPC-A, Code 128 and Code 39 barcodes with automatic check digits, then download them as PNG or SVG. Free and private.
- Encoded value
- –
- Check digit
- –
How to create a barcode
- Choose the Barcode type: EAN-13 (retail, 13 digits), UPC-A (retail, 12 digits), Code 128 (text and numbers) or Code 39 (uppercase, digits).
- Type the Content. For EAN-13, enter 12 digits and the check digit is calculated for you, or enter all 13 digits to have the last one verified. UPC-A works the same way with 11 or 12 digits. Spaces and dashes are ignored for these two types.
- For Code 39, keep Convert to uppercase automatically ticked so lowercase letters are accepted.
- Adjust the Bar width, the Height (pixels), the Bar color and the Background color, and choose whether to Show the human-readable text under the bars.
- The preview updates as you type; Create barcode refreshes it. The Encoded value and the Check digit are shown below it.
- Pick a PNG size and click Download PNG, or Download SVG for a vector file that stays sharp at any size.
Everything happens in your browser: the values you type are never sent anywhere.
Which barcode type should you use?
- EAN-13 is the standard retail barcode in most of the world (it is also called GTIN-13). It holds exactly 13 digits: a GS1 prefix, a company number, an item number and a check digit.
- UPC-A is the 12-digit retail barcode used in the United States and Canada. A UPC-A code is an EAN-13 with a leading zero, and point-of-sale scanners read both.
- Code 128 encodes all 128 ASCII characters: upper and lower case letters, digits, spaces and punctuation. It is compact and very common for shipping labels, inventory, library cards and internal asset tags. Accented letters such as “é” are not part of ASCII and are refused.
- Code 39 encodes uppercase letters, digits, the space and the symbols
- . $ / + %. It produces wider codes than Code 128 but is still required by some industrial, automotive and government systems, and almost every scanner reads it.
For a web address, a paragraph of text or contact details, a QR code is a better choice: it holds far more data and phones read it with their camera app.
How the check digit is calculated
EAN-13 and UPC-A both end with a GS1 modulo-10 check digit that lets the scanner detect a misread. Starting from the rightmost digit before the check digit, the digits are multiplied alternately by 3 and 1. For EAN-13 this means weights 1, 3, 1, 3… from the left; for UPC-A, weights 3, 1, 3, 1… from the left. Add the products, and the check digit is the number you must add to reach the next multiple of 10.
Example with 400638133393: 4×1 + 0×3 + 0×1 + 6×3 + 3×1 + 8×3 + 1×1 + 3×3 + 3×1 + 3×3 + 9×1 + 3×3 = 89. The next multiple of 10 is 90, so the check digit is 1 and the full code is 4006381333931. If you type 13 digits whose last digit is wrong, this tool tells you which digit was expected instead of drawing an invalid code.
Code 128 has its own internal checksum that is added automatically and never printed. Code 39 is drawn without an optional check character.
Printing tips
- Keep the Bar color dark and the Background color light. Red bars, light bars on a dark background and low contrast often fail to scan.
- Leave the white margin around the code (the quiet zone) and do not crop it.
- Use Download SVG for print and packaging, or Print (4×) for a large PNG. Scaling a small PNG up blurs the bars.
- Test a printed sample with the scanner or app that will actually read it.
Frequently asked questions
Can I use these EAN-13 or UPC-A codes on products I sell?
Only if the number belongs to you. Retail codes must be built from a company prefix licensed by GS1 (in Canada, GS1 Canada). This tool draws a correct barcode for any number, but it does not assign numbers, and stores or marketplaces check that the prefix is registered to your company.
Why is my EAN-13 refused?
EAN-13 accepts only digits, and it needs 12 digits (the check digit is added) or 13 digits with a correct check digit. If the last digit does not match, the message shows the expected digit.
What is the difference between Code 128 and Code 39?
Code 128 encodes the full ASCII set, including lowercase letters, and is much more compact. Code 39 is limited to uppercase letters, digits and a few symbols, but some older systems require it.
Is the SVG or the PNG better?
The SVG is a vector file: it stays perfectly sharp at any size and is ideal for printing and design software. The PNG is an image that works everywhere, such as documents, spreadsheets and label software.
Are my values uploaded?
No. The barcode is drawn by a library that runs in your browser, and nothing you type leaves your device.
Related tools
- QR Code Generator Create free QR codes for links, text, Wi-Fi, contacts, email and SMS. Add colors and a logo, then download PNG or SVG. Nothing leaves your device.
- Barcode Scanner Scan barcodes with your webcam or phone camera, or read them from a photo. EAN-13, UPC-A, Code 128, Code 39, QR, Data Matrix and more, in your browser.
- QR Code Reader Read a QR code from a photo, a screenshot or your webcam, right in the browser. Links are shown as text with phishing warnings, never opened automatically.