Barcode Generator: Create Free Barcodes Online
Barcodes are used everywhere — retail shelves, shipping labels, hospital wristbands, library books. The free barcode generator creates Code 128, EAN-13, UPC-A, Code 39, and five other formats instantly in your browser, with PNG and SVG download. No signup, no server upload.
How Barcodes Work
A barcode is a machine-readable representation of data encoded as a visual pattern. The most common type — the linear (1D) barcode — uses parallel bars and spaces of varying widths to encode characters. A barcode scanner shines a laser across the bars and measures the reflectivity at each point. Dark bars absorb light; white spaces reflect it. The resulting on/off signal is decoded into the original string by pattern-matching against the format's specification.
The first product commercially scanned using a barcode was a pack of Wrigley's Juicy Fruit chewing gum at a Marsh Supermarket in Troy, Ohio on June 26, 1974. The format was the UPC-A barcode, designed by George Laurer at IBM. Within a decade, UPC barcodes had become standard at checkout counters across North America, and by the 1980s, the EAN standard had extended the system to international retail.
Today, billions of barcodes are scanned daily across retail, logistics, healthcare, and manufacturing. Despite being over 50 years old, the basic format remains essentially unchanged — a testament to its reliability and the massive infrastructure built around it.
Barcode Format Guide
| Format | Encodes | Length | Check digit | Primary use |
|---|---|---|---|---|
| Code 128 | All 128 ASCII characters | Variable | Yes (MOD 103) | Logistics, shipping labels, internal tracking |
| EAN-13 | Digits only | 12 + 1 check | Yes | Retail product packaging (global standard) |
| UPC-A | Digits only | 11 + 1 check | Yes | Retail product packaging (USA/Canada) |
| EAN-8 | Digits only | 7 + 1 check | Yes | Small packaging — less space than EAN-13 |
| Code 39 | A–Z, 0–9, - . $ / + % space | Variable | Optional | Healthcare, government, automotive, DoD |
| ITF-14 | Digits only | 13 + 1 check | Yes | Shipping carton/case labels (GS1 standard) |
| MSI | Digits only | Variable | Yes | Warehouse shelf labels, inventory tracking |
| Pharmacode | Number 3–131070 | Variable | Self-checking | Pharmaceutical packaging (DIN/GTIN pre-label) |
How to Use the Barcode Generator
- Open the Barcode Generator
- Type your value in the input field. Each format shows a hint below the field — EAN-13 requires exactly 12 digits, Code 128 accepts any text
- Select your format from the dropdown. If an invalid value is entered for the selected format (wrong length, wrong characters), a red error message appears and download buttons disable
- Optionally adjust bar color and background color using the color pickers. Toggle the human-readable text below the bars on or off
- Click Download PNG for a raster image or Download SVG for a scalable vector file
Format Deep-Dive: Choosing the Right Barcode
Code 128 — the logistics workhorse
Code 128 is the most versatile 1D barcode format, capable of encoding all 128 ASCII characters at high density. It uses three internal character sets (Code Set A for control characters, Code Set B for uppercase and lowercase, Code Set C for pairs of digits) and switches between them automatically for maximum compression.
FedEx, UPS, DHL, and USPS all use Code 128 variants for their shipping labels. GS1-128 (a subset of Code 128) is the standard for supply chain shipping containers. Code 128 is the correct format for:
- Internal order or inventory tracking numbers
- Shipping labels for couriers and logistics providers
- Warehouse management systems (WMS)
- Mixed alphanumeric identifiers (e.g. “ITEM-A012-2026”)
EAN-13 and UPC-A — retail product codes
EAN-13 (European Article Number, 13 digits) and UPC-A (Universal Product Code, 12 digits) are the global standards for retail product identification. EAN-13 is the international standard; UPC-A is the North American subset — UPC-A codes are valid EAN-13 codes with a leading zero prepended.
These codes are assigned through the GS1 system. To use an EAN-13 or UPC-A barcode on products sold in retail stores, you must purchase a GS1 company prefix at gs1.org. The prefix identifies your company, and you assign item reference numbers within your allocated range. The 13th digit (EAN) or 12th digit (UPC) is a check digit calculated from the preceding digits using a weighted MOD-10 algorithm.
The barcode generator correctly accepts 12 digits for EAN-13 (calculating the 13th check digit automatically) and 11 digits for UPC-A (adding the check digit). Do not include the check digit yourself.
Code 39 — the universal legacy format
Code 39 was one of the first barcode formats to encode both letters and numbers. It is simpler and less dense than Code 128 but has near-universal scanner compatibility because it was standardized decades ago. The US Department of Defense, many healthcare systems, and the automotive industry standardized on Code 39 before Code 128 existed.
Code 39 is appropriate when you need to interface with legacy systems that pre-date Code 128 adoption, or when the encoding character set (A–Z, 0–9, and a few symbols) is sufficient and broad compatibility is valued over compactness.
ITF-14 — carton and shipping case labels
ITF-14 (Interleaved 2 of 5, 14 digits) is the GS1 standard for outer packaging — the barcodes on shipping boxes and pallets. It is designed for printing on corrugated cardboard, where ink absorption makes fine-detail printing difficult. ITF-14 uses thicker bars than EAN-13, tolerating the variation caused by ink bleed into corrugated surfaces.
Print Requirements for Reliable Scanning
Minimum size
For reliable scanning, standard barcodes need minimum print dimensions:
- Code 128: minimum 25 mm (1 inch) wide, 15 mm tall
- EAN-13: 37.29 mm wide × 25.93 mm tall at 100% magnification (GS1 standard)
- Code 39: depends on data length; bars must be at least 0.191 mm wide at minimum X-dimension
Smaller barcodes can work but require high-quality printing, calibrated equipment, and testing with the actual scanner hardware and distance that will be used in production.
Quiet zones — the critical blank space
Every barcode requires white quiet zones on both sides. Scanners need these blank areas to detect the start and end of the barcode pattern. Without adequate quiet zones, the scanner may not recognize the barcode as valid:
- Code 128: quiet zone = at least 10× the narrowest bar width (X-dimension) on each side
- EAN-13: 11 X-dimensions on the left, 7 on the right (specific per the GS1 standard)
- Code 39: minimum 10 X-dimensions on each side
Violating quiet zone requirements is the most common cause of barcode scan failures in production. When placing barcodes on labels or packaging, leave generous margins.
PNG vs SVG for print
SVG (Scalable Vector Graphics) is the better choice for print. SVG scales to any resolution without pixelation, so your label printer or printing press renders it at full native DPI (typically 300–1200 DPI for commercial label printing). PNG at 72 DPI will look blurry when scaled for print.
PNG is suitable for web display, quick proofing, and screen-based applications. For any physical label, packaging, or print use — always download SVG.
Print contrast requirements
Barcodes require high contrast between the bars (typically black or very dark) and the background (white or very light). The GS1 standard specifies a minimum print contrast of 0.60 on a 0–1.0 scale. Printing dark bars on a coloured background reduces contrast and increases scan failure rates. Always test your barcodes on the actual material before mass printing.
Frequently Asked Questions
What characters can Code 128 encode?
Code 128 can encode all 128 ASCII characters — uppercase and lowercase letters, digits, punctuation, and control characters. It uses three character sets internally and switches between them automatically for maximum compactness. This makes it suitable for encoding mixed data like “ITEM-0042-A” or product identifiers with letters and numbers.
Why does my EAN-13 barcode show an error?
EAN-13 requires exactly 12 digits as input — the 13th is a check digit calculated automatically. Common causes of the error: entering all 13 digits (including the check digit yourself), including spaces or dashes, or using letters. Strip the input to 12 pure numeric digits.
Can I use these barcodes on product packaging sold in stores?
Only if you have a registered GS1 company prefix and have assigned the product number within your prefix range. Retail checkout systems validate EAN-13 and UPC-A against the GS1 database. Arbitrary numbers will either fail to scan or, worse, collide with another company's registered product. Visit gs1.org to obtain a company prefix before generating retail product barcodes.
Does the tool store my barcode data?
No. Barcode generation happens entirely in your browser using the JsBarcode JavaScript library. Your input values are never sent to any server — making the tool safe for generating barcodes containing internal product codes, serial numbers, or confidential identifiers.
What is the difference between a barcode and a QR code?
A 1D barcode encodes data in a single dimension — the widths of bars and spaces across one axis. A QR code (Quick Response code) is a 2D barcode that encodes data as a matrix of dark and light squares across both horizontal and vertical axes. QR codes store far more data (up to 3,000 characters vs typically under 100 for 1D barcodes) and can be scanned with any smartphone camera. 1D barcodes are faster to scan with dedicated scanners and are the universal standard for retail and logistics.
Generate Barcodes Free
Code 128, EAN-13, UPC-A, Code 39 and more. Download PNG or SVG. No account needed.
Open Barcode Generator