Barcode Generator
Generate a barcode from text or numbers in the format you need, and download it as a PNG.
Barcode Settings
How to use this tool
Pick CODE128, EAN-13, UPC or CODE39, type the value, and the barcode redraws as you type. Bar width, bar height, colours and the printed number underneath are set in the side panel. Download PNG saves the image.
Worked example: an EAN-13 check digit
Enter the 12 digits 890123456789 as EAN-13 and the tool adds the thirteenth, the check digit, giving 8901234567890. Working from the right, the digits are multiplied by 3, 1, 3, 1 and so on and added up, which comes to 130 here; the check digit is whatever brings that to the next multiple of 10, so 0. If you type all 13 digits with a different last digit, such as 8901234567891, the tool tells you it should be 0: a scanner uses the same sum to reject a misread.
A number starting 890 is one allocated by GS1 India. The prefix shows which GS1 organisation issued the number, not where the product was made.
Printing it so it scans
- Keep dark bars on a light background; not every scanner can read a reversed, light-on-dark code.
- Leave the white margin around the code, as the downloaded image does. Scanners need that quiet space to find where the code starts and ends.
- Scale the PNG in whole steps, 200% or 300%, rather than stretching it to fit a box, which makes some bars wider than others.
- For CODE39, type in capitals or let the tool convert;
_and other symbols outside its set are refused.
Frequently Asked Questions
Why do EAN-13 and UPC require an exact number of digits?
Both are fixed-length retail standards where the last digit is a checksum calculated from the digits before it, not free-form data — that's what lets a scanner detect a misread. Enter 12 digits for EAN-13 or 11 for UPC and the checksum digit is calculated and appended automatically; enter the full 13 or 12 digits yourself and it's validated instead of recalculated.
Can I use a barcode generated here on a real retail product?
This tool renders any value you give it into correct, scannable barcode symbology, but a real UPC or EAN-13 number for retail sale needs to be officially assigned to you through GS1 (or a reseller) so it uniquely identifies your product in retailers' systems — this tool doesn't assign or register numbers. Making up an unregistered number and printing it will scan technically correctly but isn't a real retail barcode.
Which format should I use for an internal asset tag or inventory code, not retail?
CODE128 in most cases. Neither it nor CODE39 needs a registered number, but they accept different characters. CODE128 takes letters in both cases, digits and punctuation. CODE39 only has digits, capital letters and seven symbols (- . space $ / + %): this generator converts lowercase letters to capitals and rejects anything else. CODE39 also needs more width for the same text, so choose it only when an existing scanner or label system asks for it.
Related Tools
Related Blog Posts
How to Use QR Codes for Marketing, Docs, and Events
How much a QR code can hold, why a shorter or uppercase link gives a code that scans more easily, what error correction actually protects against, and how to size one for print.
Read moreHEX, RGB and HSL: How the Conversions Work and Where They Round
#4F46E5 converted to RGB and HSL step by step, why 89.4% of all colours change when copied as whole-number HSL, why HSL lightness is not brightness (yellow and blue at 50% differ eightfold in contrast), and the alpha that hex can't write exactly.
Read more10 CSS Gradient Ideas You Can Copy and Customize
Ten copy-ready CSS gradients (buttons, dark surfaces, progress bars, stripes, glows, gradient text, photo overlays), plus how gradient angles work and how to avoid the muddy grey middle.
Read more