Barcode Generator
What This Tool Does
This barcode generator produces standard 1D barcodes in the most common formats used in retail, logistics, and inventory. Enter your code, choose the format, customize size and color, and download as PNG (for printing) or SVG (for scaling). The tool uses the JsBarcode library to ensure barcodes are valid and readable by standard scanners.
Inputs Explained
- Barcode Data: The code to encode. Format-specific rules apply (e.g., EAN-13 requires 12-13 digits).
- Format: Code 128 (general), EAN-13 (retail), UPC-A (US retail), Code 39 (industrial), ITF-14 (logistics).
- Width & Height: Bar width in pixels and total barcode height.
- Show Text: Display the readable text below the bars.
How It Works
The JsBarcode library (loaded from CDN) accepts your data and format, validates the input, computes the proper bar/space sequence according to the format's specification, and renders it onto an SVG or Canvas element. The output is a scan-ready barcode that any standard barcode reader can decode.
Formula / Logic Used
Create Code 128, EAN-13, UPC-A, Code 39, and ITF barcodes — download as PNG or SVG.
Step-by-Step Example
Common barcode examples:
- Code 128:
ORDER-2025-0423(any text, most flexible) - EAN-13:
5901234123457(European retail, 13 digits) - UPC-A:
036000291452(US retail, 12 digits) - Code 39:
ABC-123(uppercase, digits, dashes) - ITF-14:
12345678901231(shipping cartons, 14 digits)
The tool automatically computes and appends check digits for EAN/UPC formats. Just provide the data portion.
Use Cases
- Inventory management: Generate Code 128 barcodes for internal stock tracking, no product code registration needed.
- Asset tagging: Label equipment, books, or files with scannable Code 39 codes for easy check-in/check-out.
- Event tickets: Create unique Code 128 barcodes for admission tickets that can be scanned at entry.
- Shipping labels: Generate ITF-14 codes for GTIN-based shipping carton identification.
- Small retail: Create product barcodes for small businesses that don't need registered GS1 codes.
Assumptions and Limitations
- For EAN and UPC formats, you need a GS1-registered prefix to sell in real retail. This tool generates valid format but not globally unique codes.
- Barcode scanners need sufficient contrast — avoid low-contrast colors (light grey on white) for printed output.
- The tool generates 1D barcodes. For 2D codes, use the QR Code Generator.
- The JsBarcode library is loaded from jsDelivr CDN on first use; requires internet initially.
Barcode Generator 128
Use barcode generator 128 when you need a Code 128 barcode for inventory labels, order IDs, shipping references, or alphanumeric product codes. Code 128 is compact and supports numbers, uppercase letters, lowercase letters, and many symbols.
Frequently Asked Questions
Which barcode format should I use?
Depends on the use case. Code 128 - flexible, accepts the full ASCII set, compact - is the go-to for internal inventory, packaging labels, shipping tags, anything text-based. EAN-13 and UPC-A are mandatory for retail products with a registered GTIN going through real point-of-sale systems. Code 39 is older, only handles uppercase letters and digits, but still common in manufacturing, defense and industrial environments because legacy scanners universally support it. ITF-14 is for shipping cartons containing groups of UPC items. For most internal projects, default to Code 128. Match the standard your downstream system actually expects.
What is the difference between Code 128 and UPC?
Code 128 is a flexible internal-use barcode - it accepts any ASCII text (numbers, letters, symbols), encodes compactly, and is widely supported by handheld scanners. Use it for SKUs, asset tags, internal tracking, batch numbers, anything where you control both ends. UPC-A (the standard 12-digit barcode you see on retail packaging) is rigid by design: exactly 12 digits including a check digit, registered with GS1, intended for point-of-sale scanning at real retailers. Walmart, Target, Amazon all expect UPC-A or EAN-13 for retail products, not Code 128. Pick by audience - internal versus retail.
Do I need a GS1 barcode for my product?
For real retail distribution, almost certainly yes. GS1 issues registered company prefixes that ensure your UPC-A or EAN-13 codes are globally unique - that's what major retailers like Walmart, Target, Amazon and most supermarket chains require for product listings. They scan, look up the GTIN, and expect it to resolve to your company. Skipping GS1 and inventing your own UPC numbers risks collisions with someone else's products, which is a mess to untangle. For purely internal use - warehouse SKUs, asset tags, work-order tracking - skip GS1 entirely and use Code 128 or Code 39 with whatever numbering you like.
Why is my EAN-13 barcode invalid?
Two common issues. Length: EAN-13 needs exactly 12 digits of data plus 1 check digit, totaling 13 - or 12 digits where you let the encoder calculate the check digit for you. Anything else throws an error. Check digit: the last digit isn't arbitrary, it's calculated from the previous 12 using a specific weighted sum (multiply alternating digits by 1 and 3, sum them, find the difference to the next multiple of 10). Get the check digit wrong and any retail scanner will reject it. Use the generator's auto-calculation or paste only the 12 base digits and let it append.
What is a barcode check digit?
The final digit appended to barcodes like EAN-13, UPC-A, ITF-14 to detect errors during scanning or manual entry. It's calculated from the preceding digits using a specific algorithm - usually a weighted sum where alternating positions are multiplied by 1 and 3, summed, and the check digit is the value that brings the total to the next multiple of 10. If a single digit gets misread by a scanner, or someone mistypes a number, the check digit math fails and the system rejects the input. It's a simple, fast integrity check baked into the barcode standard itself.
Should I download barcode as PNG or SVG?
SVG for anything going to print or any context where it might get scaled - posters, packaging artwork, multi-size labels. SVG is vector, so it stays razor-sharp at any size and prints cleanly at 300 DPI or higher. PNG works fine for fixed-size on-screen use, slides, internal documents, or when the destination tool doesn't speak SVG (some older POS software, basic editors). For label sheets in InDesign, Illustrator or any modern design tool, SVG is the right pick. Generate at the size you need, but vector means you don't have to worry about resolution decisions.
What is the difference between 1D and 2D barcodes?
1D barcodes - the classic stripes you see on product packaging - encode data along a single horizontal axis using parallel bars of varying widths. They hold limited data, typically 10-40 characters, and need a laser scanner or 1D camera to read. 2D barcodes (QR codes, Data Matrix, Aztec) use a grid of light and dark cells across both dimensions, packing far more data - thousands of characters - into the same physical space. They're decoded by camera-based scanners, which most phones already have. For tiny labels or rich payloads (URLs, vCards, ticket data), go 2D. For retail product codes, 1D still rules.
Can I generate barcodes for internal inventory?
Absolutely - this is one of the most common reasons teams build their own barcode systems. For internal SKUs, asset tags, warehouse bin labels and work orders, you don't need GS1 registration or any external authority. Pick Code 128 for flexibility (accepts any ASCII, compact encoding) or Code 39 if you're working with older industrial scanners that only do basic alphanumeric. Print them on standard label sheets, scan with any handheld or phone-based scanner, and feed the data into your inventory system. Just keep your numbering scheme consistent and document it so the team knows the convention.
Sources and References
- JsBarcode Library — Open-source barcode generation library used here.
- GS1 — Barcodes — Official body for retail barcode standards.
- Wikipedia — Code 128 — Detailed explanation of Code 128 format.
- Wikipedia — International Article Number — EAN-13 format and check digit calculation.