Barcode Generator

Agarapu Ramesh — Editor and content reviewer

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

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

Format-specific: each format has a unique pattern encoding (e.g., Code 128 has 107 characters × 11 modules each) Output = renderer(format, data, width, height)

Create Code 128, EAN-13, UPC-A, Code 39, and ITF barcodes — download as PNG or SVG.

Code 128: Any ASCII, most flexible. Use for general-purpose codes.
EAN-13: 12 digits + 1 check digit (13 total). European retail.
UPC-A: 11 digits + 1 check digit (12 total). US retail.
Code 39: Uppercase A-Z, 0-9, symbols. Common in industry.
ITF-14: 14 digits. Shipping cartons (GTIN).

Step-by-Step Example

Common barcode examples:

The tool automatically computes and appends check digits for EAN/UPC formats. Just provide the data portion.

Use Cases

Assumptions and Limitations

Disclaimer: For commercial retail products, register your company with GS1 to get globally unique EAN/UPC codes. This tool is ideal for internal use, asset tagging, and prototyping.

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

Related Calculators

QR Code GeneratorQR Code ReaderUUID GeneratorHash GeneratorImage Format ConverterPlaceholder Image