Barcode Generator
Generate Code 128, EAN and UPC barcodes as PNG/SVG.
About the Barcode Generator
The Barcode Generator produces one-dimensional linear barcodes in the six most common symbologies: Code 128, Code 39, EAN-13, EAN-8, UPC-A, and ISBN. Each symbology serves a specific industry — Code 128 for shipping and logistics, EAN-13 and UPC-A for retail point-of-sale, Code 39 for industrial asset tracking, and ISBN for book barcodes on the back cover.
Barcodes predate QR codes by several decades and remain the dominant identification technology at retail checkout. The reasons are simple: barcode scanners are cheap (under $30), the printed codes are highly tolerant to print defects, and the symbologies are international standards enforced by GS1 (the global standards organization for supply-chain barcodes) and ISO.
This tool renders barcodes via the public bwipjs-api.metafloor.com endpoint, which uses the Barcode Writer in Pure JavaScript (bwip-js) library to produce PNG output. The bwip-js library implements the complete set of ISO/IEC and GS1 barcode specifications, including automatic check-digit calculation for EAN, UPC, and ISBN codes.
How It Works
Each barcode symbology encodes data as a sequence of alternating black bars and white spaces of varying widths. The encoder maps each input character (or pair of characters) to a specific pattern of bars and spaces defined by the symbology’s specification.
- Code 128 — the most expressive linear symbology. Encodes all 128 ASCII characters in three sub-codes (A, B, C). Sub-code C packs pairs of digits into a single character pattern, doubling density for numeric data. Used by UPS, FedEx, and the UCC-128 shipping container labels.
- Code 39 — the legacy industrial symbology. Encodes uppercase letters, digits, and the symbols
- . $ / + % space. Each character is encoded as 9 elements (5 bars and 4 spaces), of which 3 are wide. Self-checking — no check digit required. - EAN-13 — the global retail barcode. 13 digits: a 2-3 digit country/GS1 prefix, a 4-6 digit company code, a 3-5 digit product code, and a final check digit. The check digit is computed by the Luhn-like EAN algorithm.
- EAN-8 — a shorter version of EAN-13 for small retail items (chewing gum, lip balm). 8 digits total, with the same check-digit algorithm.
- UPC-A — the North American retail barcode, structurally identical to EAN-13 with a 12-digit length and a leading zero country code implied. Used on every consumer product sold in the U.S. and Canada.
- ISBN — a book barcode that wraps an ISBN-13 identifier in an EAN-13 envelope, with an optional 5-digit add-on for the suggested retail price.
For EAN/UPC/ISBN, the generator accepts 12 digits (no check digit) or 13 digits (with check digit). The bwip-js encoder validates or recalculates the check digit automatically using the standard EAN algorithm: multiply alternating digits by 1 and 3, sum, then take the smallest multiple of 10 that is greater than or equal to the sum and subtract.
The bar height parameter controls the physical height of the bars in millimeters — this matters for printing because taller bars are more tolerant of scanner misalignment but take up more label space. ISO/IEC 15420 specifies a minimum height of 9.7mm for EAN-13.
Worked Examples
Encoding the default 123456789012 as EAN-13 produces a 13-digit barcode with check digit 8 (the encoder computes it from the input 12 digits). The resulting image is the standard retail-format barcode you see on every consumer product, scannable by any retail point-of-sale scanner worldwide.
Encoding Hello World as Code 128 produces a single barcode that includes uppercase, lowercase, and a space — something EAN/UPC cannot do. Code 128 is the default for shipping labels (FedEx, UPS) precisely because it can encode arbitrary ASCII.
For a book’s ISBN barcode, enter the 13-digit ISBN (e.g., 9780132350884 for Clean Code) with type ISBN. The output is the EAN-13 barcode printed on every book’s back cover, scannable at bookstores and libraries worldwide.
For an industrial asset tag using Code 39, enter an uppercase identifier like ASSET-007-A. Code 39 is self-checking — a single misprinted bar usually produces a scan failure rather than a wrong value, which is why it dominates manufacturing and warehouse applications.
When to Use This Tool
- Printing retail barcodes for products not yet in your inventory system (small-batch artisanal products, custom labels).
- Generating shipping labels with Code 128 for FedEx, UPS, or USPS shipments.
- Creating ISBN barcodes for self-published books to be sold through bookstores and libraries.
- Producing asset tags for office equipment, lab instruments, and manufacturing tooling.
- Generating event-ticket barcodes for check-in (Code 128 for alphanumeric ticket IDs).
- Creating library barcode labels for book spine and patron card scanning.
- Building prototype barcode scanners and POS systems without needing commercial barcode software.
Limitations & Disclaimer
This tool relies on the third-party bwipjs-api.metafloor.com service to render barcodes. While the connection is HTTPS-encrypted, your input data is transmitted to that service and may be subject to their logging policy. Do not encode personal data, customer identifiers, or sensitive serial numbers. Validation is performed client-side for the most common error cases (wrong digit count, invalid characters) but the final rendering is the API’s responsibility. For mission-critical production barcode generation (retail product labels, pharmaceutical serialization), use a self-hosted GS1-certified barcode library. Print at 300+ DPI and verify with a real scanner before mass production. See our disclaimer for full terms.
Frequently Asked Questions
Why does my EAN-13 input need a 13th digit?
It does not — you can provide 12 digits and the generator computes the 13th check digit automatically using the EAN algorithm (alternating multiply by 1 and 3, then take the next multiple of 10). If you provide 13 digits, the encoder validates the check digit and rejects invalid input. This prevents typos that would otherwise produce a wrong-product scan at retail checkout.
Can I encode lowercase letters?
Only with Code 128. Code 39 supports uppercase letters, digits, and the symbols <code>- . $ / + % space</code> only. EAN-13, EAN-8, UPC-A, and ISBN accept digits only. For arbitrary text, choose Code 128.
What is the difference between UPC-A and EAN-13?
They are functionally identical — a UPC-A barcode is just an EAN-13 with a leading zero country code (representing the U.S. and Canada). Modern scanners treat them interchangeably. The GS1 organization merged the two standards in 2005; today EAN-13 is the global default and UPC-A is the North American legacy subset.
How small can I print a barcode?
The minimum printable size depends on the symbology and the printer resolution. EAN-13 at the standard 80% magnification is 29.83mm wide and 21.56mm tall. Below 80% magnification, retail scanners start to fail. Code 128 can be printed more compactly because of its higher density. Print at 300 DPI minimum for reliable scanning.
Why is my barcode not scanning?
Common causes: the quiet zone (white margin) is too narrow (need at least 10x the narrowest bar width on each side), the print contrast is too low (need at least 70% contrast), the bar height is too short for the scanner’s tolerance, or the data has a wrong check digit. Increase the height, ensure white background, and verify the input data.
Is the data sent to the API private?
The data is sent over HTTPS to <code>bwipjs-api.metafloor.com</code>, a third-party service operated by the maintainer of bwip-js. The connection is encrypted but the operator could theoretically log your input. Do not encode private customer data or sensitive identifiers. For sensitive content, self-host the bwip-js library.
Last updated: July 21, 2026 · Author: HT99 Tools Editorial Team · Reviewed by: HT99 Tools Editorial Team