About Barcode Generator
This barcode generator uses JsBarcode to encode text or numbers into one-dimensional barcodes locally in your browser. It supports eight symbologies — CODE128, EAN-13, EAN-8, UPC-A, CODE39, ITF-14, MSI and pharmacode — and downloads a white-background PNG. Pick by payload: CODE128 covers the full ASCII set and suits mixed alphanumeric inventory and asset IDs; EAN-13 and UPC-A follow retail rules and auto-append the 13th check digit when given 12 digits. CODE39 has a small character set but is widely compatible; ITF-14 is for shipping cases and pharmacode for pharmaceutical packaging. A payload that does not match the symbology raises an error instead of drawing a structurally invalid symbol. Bar width, height and margins are fixed here (2 px modules, 80 px height, library-default margins), and there is no SVG output — so this is a quick-draft and ad-hoc printing tool, not a packaging-print layout tool. Verify before printing: pixel measurement of this page's EAN-13 output found 101 modules against the textbook 95 (six extra, cause unattributed), so this page does not claim module-exact conformance to ISO/IEC 15420.
How It Works Internally
A 1D barcode encodes data in the widths of bars and spaces and includes a check digit or special start and stop symbols, so content cannot be assembled casually: EAN-13 and Code 128 each define their own character set and checksum, and a hand-built digit string usually will not scan. Generation belongs to a complete implementation, and a checksum failure should error rather than silently emit an unusable symbol.
The first twelve digits of an EAN-13The thirteenth is computed from the first twelve by weighted modulo ten — an error makes scanners reject the symbol outrightMeasured on This Page
| Rendering structure | EAN-13 with a 12-digit input (check digit auto-added) produced 55 runs whose widths are only 2/4/6/8 px (1/2/3/4 modules) and start dark — bar widths are whole multiples of the module, with no sub-pixel artefacts |
|---|---|
| 101 modules vs 95 textbook | Measured span 202 px / 2 = 101 modules, six more than the EAN-13 textbook value of 95. The difference is unattributed (possibly guard-bar rendering or counted margins), so this page only claims 'rendered by the library', not 'module-exact per ISO/IEC 15420' |
| Input validation | EAN-13 rejects ABC123 with an error instead of drawing an invalid barcode; CODE128 accepts alphanumeric input |
| Check digit | For 12-digit input the library appends the 13th check digit — it is JsBarcode's behaviour, the page does not compute it |
Drawing a barcode and scanning one are different claims: this page delegates encoding to JsBarcode and performs no decode regression (the rendered image is never scanned back to the original digits). Pixel measurement found 101 modules against the textbook 95 — six extra, unattributed, possibly guard-bar rendering or counted margins — so 'conforms exactly to EAN-13' is not a claim this page can make. Practical advice: print one and scan it with a reader or phone before production, especially after shrinking, where insufficient bar width is the usual failure.
How to Use
- Open "Barcode Generator"
- Pick a symbology and type the value
- The barcode redraws on every change
- Scan the result with a reader or phone
- Click "PNG" to download a white-background image
Use Cases
- Retail product barcodes — Generate EAN-13 or UPC-A barcodes for retail products for packaging printing and checkout scanning.
- Inventory management labels — Use CODE128 to generate alphanumeric inventory barcodes for warehouse scan-in and scan-out.
- Logistics tracking codes — Generate ITF-14 logistics case barcodes for supply chain shipping carton identification and tracking.
- Pharmaceutical codes — Generate pharmacode barcodes for pharmaceutical packaging identification and compliance labeling.
- Event check-in codes — Use CODE39 to generate participant number barcodes for quick scan-based check-in and verification.
FAQ
How is the EAN-13 checksum calculated?
It uses the GS1 modulo-10 weighted algorithm: multiply odd positions by 1 and even positions by 3, sum them, then subtract the units digit from 10. The tool auto-calculates and appends it.
What is the difference between CODE128 and CODE39?
CODE128 supports the full ASCII set with higher density, suited for long data; CODE39 supports only 43 characters (uppercase, digits, some symbols) but is simpler and widely compatible.
Can it export SVG vector format?
No. This tool outputs only a white-background PNG rendered by JsBarcode; there is no SVG export and no controls for bar width, height, margins or colors. For vector output or exact dimensions, call JsBarcode or another barcode library directly with your target specification.
Can generated barcodes be read by scanners?
The output follows each symbology's rules (EAN-13 gets its check digit, invalid characters raise an error), but this page performs no decode regression. Whether it scans depends on symbology, print size and reader: modules are fixed at 2 px, so shrinking may break scanning — test with your target device.
My barcode is too dense to scan - what now?
This tool exposes no bar-width or height controls (2 px modules, 80 px height). What you can change is the output: print at a larger size, shorten the payload, or switch to a denser symbology such as CODE128, while keeping strong dark-on-light contrast.
Is the data uploaded?
No. All barcode generation runs locally in your browser via JsBarcode with no network requests, so even sensitive code values stay on your device.
The barcode does not scan with my scanner?
Check three things: the symbology must match your scanner (EAN-13 for retail, Code128 for logistics — not interchangeable), the quiet zones must not be cropped off the image, and the printed size must not be too small (modules are fixed at 2 px and merge when shrunk). Print larger and test with the actual reader.
Are barcodes interchangeable with QR codes?
No. Barcodes carry little data (dozens of characters), scan only horizontally and cost almost nothing — ideal for retail and inventory. QR codes hold URLs and contact data with error correction and Chinese support, suiting marketing and payments. Choose by reader: scanner guns use barcodes, phone cameras use QR.