Home / Free tools / Free barcode generator
Free barcode generator
This free barcode generator makes a barcode in your browser, online, with no sign up. Type your text or number, pick Code 128, EAN-13, UPC-A or Code 39, and download the result as SVG or PNG.
How to use the free barcode generator
- Pick a format. Choose Code 128, EAN-13, UPC-A or Code 39. If you are not sure, read the table below.
- Type your text or number. The barcode redraws as you type. If the format cannot hold what you typed, a message tells you what to change.
- Set the look. Choose a short, medium or tall bar height. Show or hide the readable text under the bars.
- Download. Use SVG for print, because it stays sharp at any size. Use PNG for documents, spreadsheets and web pages.
Everything happens on your device. Nothing you type is uploaded.
Which barcode format should you use?
| Format | What it holds | Length | Common use |
|---|---|---|---|
| Code 128 | Letters, digits and symbols | Any | Shipping labels, stock, asset tags |
| EAN-13 | Digits only | 13 digits | Retail products worldwide |
| UPC-A | Digits only | 12 digits | Retail products in the US and Canada |
| Code 39 | Capitals, digits and 7 symbols | Any | ID badges, older scanner systems |
- Code 128 is the best choice for your own labels. It handles upper and lower case, digits and punctuation, and it is compact.
- EAN-13 and UPC-A are the barcodes on products in shops. Use them only with a number that belongs to your product. This tool works as a UPC barcode generator for a number you already have.
- Code 39 is older and wider. Pick it when a scanner or a system you work with asks for it.
Retail numbers come from GS1
The generator draws the bars. It does not assign numbers. A UPC or EAN that will be scanned at a shop checkout or listed on a marketplace must be issued by GS1, the body that manages these numbers, so that it is unique to your company and product. For internal use, such as stock rooms, equipment and event tickets, you can encode any number you like.
How the check digit works
The last digit of an EAN-13 or UPC-A is a check digit. A scanner recalculates it on every read and rejects the scan if it does not match. Type the number without it and the generator adds it. Type the full number and the generator checks it for you.
Worked example: EAN-13
Take the first 12 digits 400638133393.
- Add the digits in odd positions (1st, 3rd, 5th and so on): 4 + 0 + 3 + 1 + 3 + 9 = 20.
- Add the digits in even positions: 0 + 6 + 8 + 3 + 3 + 3 = 23. Multiply by 3: 69.
- Add the two results: 20 + 69 = 89.
- The check digit is what takes you to the next multiple of 10: 90 − 89 = 1.
The full number is 4006381333931. UPC-A works the same way with the weights swapped: the odd positions are multiplied by 3. For 03600029145 that gives 14 × 3 + 16 = 58, so the check digit is 2 and the full number is 036000291452.
Code 128 has its own checksum built into the bars, so you never type it. Code 39 has none by default.
Tips for barcodes that scan first time
- Keep the white margin. The blank space on each side is called the quiet zone. Scanners need it. Do not crop it or place text inside it.
- Use dark bars on a light background. Black on white is safest. If you want brand colors, check the contrast with the hex color picker first. Avoid red bars, because many scanners use red light and cannot see them.
- Do not stretch it sideways. Resize the barcode in proportion. Changing the width alone changes the bar widths.
- Test before you print a batch. Print one label and scan it with the scanner or phone app you will use.
Making price labels for a sale? Work out the new price with the discount calculator. More tools are on the free online tools page.
How this barcode generator was checked
Built by Rasel Hakkani, WordPress developer at Swift Web Dev. Every format was drawn and then read back with barcode decoding software, and the check digits were verified against known EAN-13 and UPC-A codes. It has not been tested with every physical scanner, so print one and scan it before a large print run.
Sources
Last checked: October 2026. Found a wrong answer? Tell us and we will fix it.
Free barcode generator questions
Is this barcode generator free to use online?
Yes. It is free, it works online in your browser and there is no sign up. The barcode is drawn on your device and nothing you type is sent to a server.
Can I use these barcodes on products I sell in shops?
Yes, if the number is yours. Retail UPC and EAN numbers must be issued by GS1. The generator draws the bars for a number you already have. It does not create or register product numbers.
What is the difference between UPC-A and EAN-13?
UPC-A has 12 digits and is the standard in the US and Canada. EAN-13 has 13 digits and is used worldwide. A UPC-A is the same as an EAN-13 with a 0 in front, and modern scanners read both.
Which barcode format can hold letters?
Code 128 and Code 39. Code 128 takes upper and lower case letters, digits and symbols. Code 39 takes capital letters, digits and seven symbols. EAN-13 and UPC-A take digits only.
Should I download SVG or PNG?
Use SVG for anything you print, because it stays sharp at any size. Use PNG when a program does not accept SVG, such as some word processors and label apps.
Why does the generator say my check digit is wrong?
The last digit of your number does not match the one worked out from the other digits. That usually means a typo. Compare each digit with your source, or leave the last digit off and let the generator add it.
More free tools
Need a calculator like this on your website?
Swift Web Dev builds custom calculators and tools for WordPress sites: quote forms, pricing estimators, booking logic and more.