Barcode generator: make Code 128, EAN-13, UPC-A and more
Choose the barcode type, type the value, and download the barcode as SVG or PNG. Check digits are calculated and checked for you.
Free · no signup Runs in your browser
How do I make a barcode online?
Choose the type (Code 128 takes any text; EAN-13 and UPC-A are for retail products), type the number or text and the barcode appears at once. Change the width, height, colours and whether the number is printed under it, then download it as SVG for print or PNG for screens. For EAN and UPC codes, type the digits without the last one and the check digit is added; if you type all digits, it is checked, and an invalid number is rejected.
Why we built this tool
Barcodes are used for much more than checkout counters: inventory labels, shelf and bin numbers, asset tags, library cards, ticket and badge IDs, shipping references, and school and event passes. Making one should not need a paid subscription or an account, nor should you have to trust a site that uploads the number you type, which may be an internal part number or a customer reference. This generator draws the barcode in your browser, supports the main formats, checks that the value is valid for the format, works out check digits, and gives you a crisp vector SVG for printing as well as a PNG.
The barcode is drawn in your browser. Nothing is uploaded, and there is no watermark.
How it works in detail
A barcode turns characters into a pattern of bars and spaces of different widths, which a scanner reads as a line of light and dark. Each format has its own rules. Code 128 can encode all 128 ASCII characters, and switches between three code sets so that long runs of digits are packed two to a bar group; it ends with a check character and a stop pattern, so scanners can detect misreads. EAN-13 and UPC-A encode digits only, in 7-module groups drawn from three tables (left odd, left even and right), with start, middle and end guard bars; the thirteenth digit, the check digit, is calculated from the other twelve: add the digits in the odd positions, add three times the digits in the even positions, and the check digit is whatever brings the total up to the next multiple of ten. A UPC-A code is the same as an EAN-13 with a leading zero. Code 39 uses nine elements per character, three of them wide. ITF-14 is used on cartons.
The drawing is made with the JsBarcode library. The tool shows the value that was actually encoded, so you can see the check digit it added. SVG is exact at any size; PNG is drawn at twice the preview resolution.
How to use it
- Choose the type. If you are unsure, use Code 128 for internal use and EAN-13 or UPC-A only for retail product codes you have been given.
- Type the value. The hint under the box says what the type accepts.
- Set the bar width and height, margin and colours. Keep dark bars on a light background.
- Check the printed number under the bars, then download SVG (for printing and design) or PNG.
- Print it at a good size and scan it before you print many: a scanner or the QR and barcode scanner tool can check it.
Which barcode should I use?
A short guide to the formats on this page.
| Type | What it can hold | Typical use |
|---|---|---|
| Code 128 | Any letters, digits and symbols | Shipping labels, inventory, asset tags, internal IDs |
| EAN-13 | 13 digits | Retail products worldwide |
| UPC-A | 12 digits | Retail products in Canada and the United States |
| EAN-8 | 8 digits | Small packages |
| Code 39 | Capital letters, digits and a few symbols | Industry, defence, ID badges |
| ITF-14 | 14 digits | Cartons and cases of products |
| Interleaved 2 of 5 | An even number of digits | Warehouse and distribution |
| MSI | Digits | Shelf labels in warehouses and stores |
| Pharmacode | A number from 3 to 131,070 | Pharmaceutical packaging |
| Codabar | Digits and a few symbols | Libraries, blood banks, parcels |
Use cases
- Inventory, bin and shelf labels
- Asset tags and equipment IDs
- Event tickets, passes and badges
- Library and membership cards
- Shipping and return references
- Teaching how barcodes and check digits work
Problems you may run into
Most trouble is about the number and the printing.
| What you see | Likely cause | What to do |
|---|---|---|
| 'That value does not fit this barcode' | Wrong length, a letter in a digits-only type, or a wrong check digit | Follow the hint; for EAN and UPC give all digits except the last, or a correct full number |
| The scanner will not read it | Too small, low contrast, a smudged print or no blank margin | Print larger, dark on light, keep the margin, use a good printer |
| My EAN-13 is accepted at home but rejected by a retailer | Retail barcodes must use a registered company prefix | In Canada, get your prefix from GS1 Canada; do not invent product numbers |
| The number under the bars is different from what I typed | A check digit was added | That is normal for EAN and UPC when you type one digit fewer |
| The PNG looks soft when printed | PNG is made of pixels | Use the SVG for print, which is exact at any size |
| The barcode has no text under it | The text option is off | Tick 'Show the number under the barcode' |
Retail product barcodes are not free-for-all
Anyone can make a Code 128 barcode for their own system, but a barcode on a product sold through retailers must carry a globally unique number (a GTIN) built from a company prefix that is licensed from GS1, the standards body. In Canada that organization is GS1 Canada. Making up an EAN or UPC number can clash with someone else's product and will be rejected by many retailers and marketplaces. Use this tool to draw a barcode for a number you are entitled to use, and for internal purposes.
How it works
Everything runs in your browser.
1. You choose the type and type the value; the tool checks it against the type's rules.2. For EAN, UPC and ITF-14 the check digit is worked out (odd-position digits × 1 plus even-position digits × 3; add whatever reaches the next ten).3. The value becomes a pattern of bars and spaces, with guard or start and stop patterns, drawn as SVG.4. SVG or PNG is saved from the drawing. Nothing is uploaded.
Drawing is by JsBarcode 3.11.6 (MIT). Check digits follow the GS1 method for EAN-13, UPC-A, EAN-8 and ITF-14. Code 128 includes its own check character. Always test a barcode with the scanner that will read it, at the size you will print it.
Example: an EAN-13 check digit
The first twelve digits are 590123412345.
- Odd positions5 + 0 + 2 + 4 + 2 + 4 = 17
- Even positions × 3(9 + 1 + 3 + 1 + 3 + 5) × 3 = 22 × 3 = 66
- Total17 + 66 = 83; the next multiple of 10 is 90
- Check digit90 − 83 = 7
5901234123457
Type the first twelve digits and the tool adds the 7.
Terms on this page
- Check digit
- A final digit calculated from the others so that a scanner can detect a misread.
- GTIN
- Global Trade Item Number: the number encoded in a retail product barcode.
- Quiet zone
- The blank margin around a barcode that a scanner needs in order to read it.
Common questions
Is it free, and is anything uploaded?
It is free, and the barcode is drawn in your browser. Nothing you type is sent anywhere.
What is the best barcode for inventory?
Code 128 is the usual choice: it takes letters and digits and has error checking.
Can I make a UPC for my product?
You can draw one, but a retail product needs a number licensed from GS1 (GS1 Canada in Canada).
How do I make an EAN-13?
Type 12 digits and the tool adds the check digit, or type 13 digits and it checks them.
SVG or PNG?
SVG for printing and design, because it stays sharp at any size; PNG for screens and documents.
How big should I print it?
At least 80% of the nominal size for retail codes; larger is safer. Test it with your scanner.
Can I scan the barcode I made?
Yes, with the QR code and barcode scanner on this site in browsers that read barcodes, or with a handheld scanner.
Is anything I enter sent to a server?
No. The calculation happens in your browser and nothing you type leaves your device.
Where these numbers come from
- JsBarcode — barcode generator library The library that draws Code 128, EAN, UPC, Code 39, ITF and other barcodes (MIT).
- Wikipedia — International Article Number (EAN) How EAN-13 and EAN-8 barcodes are built and how the check digit is calculated.
- Wikipedia — Universal Product Code (UPC) How UPC-A barcodes are built and how the check digit is calculated.
- Wikipedia — Code 128 How Code 128 encodes text and numbers and checks itself.
- GS1 Canada The organization that issues company prefixes for product barcodes (GTINs) in Canada.
Last verified 2026-10-25 The method on this page is checked against the sources above at least once a year. Spotted something out of date? Tell us and we will fix it.
Related tools
QR code generator
Make a QR code for a link, text, Wi-Fi network, email, phone number, text message or contact card, and download it as PNG or SVG.
Open toolQR code scanner
Scan a QR code or barcode with your camera, or read one from a picture, and see what is inside before you open anything. Free, private, nothing is uploaded.
Open toolUUID generator
Generate random version 4 or time-ordered version 7 UUIDs, one or many, in the format you need.
Open toolHash generator
Get the SHA-256, SHA-512, SHA-384 and SHA-1 hash of text or of a file, and check a download against a hash you were given.
Open tool▦ QR code and barcode tools
Create QR codes and barcodes in your browser, and scan them with a camera or a picture. Nothing is uploaded or logged.
See all 3 tools in this section