Generate Code 39 barcodes for inventory, healthcare, and automotive applications. Free online tool, instant SVG and PNG download. No sign-up required.
The Code 39 barcode (also known as "Code 3 of 9") is a discrete linear symbology that has been the backbone of industrial asset identification for over fifty years. It was the first symbology capable of encoding both letters and numbers.
Enter your character sequence (A-Z, 0-9). Code 39 uses a 9-element discrete architecture for high durability.
Our engine automatically frames your data with asterisk (*) sentinels, ensuring scanners identify the start and stop boundaries.
Review and download the high-resolution SVG or PNG manifest. No sign-up or watermarks required for LOGMARS compliance.
Each character is composed of 9 elements: 5 bars and 4 spaces. Exactly three of these elements are "wide," while the other six are "narrow." This binary-like pattern provides an exceptional level of physical durability for labels.
Code 39 remains the primary standard for the U.S. Department of Defense (LOGMARS) and the automotive industry (AIAG). Its simplicity and self-checking nature make it ideal for high-stakes regulatory environments and internal inventory control.
Industrial asset identifiers are high-value operational data. MyUtilityBox enforces Zero-Ingestion Encoding. All barcode transformations occur in your local V8 memory, ensuring total integrity of your part numbers.
MyUtilityBox enforces a Strict Local Execution Sandbox. All barcode generation and element mapping occur exclusively in your browser memory. We never ingest your strings.
Technical Standards
Choosing the wrong barcode symbology for your use case is a systemic error that propagates throughout the entire supply chain. The two most commonly confused standards are Code 128 — a variable-length alphanumeric workhorse — and UPC-A — a fixed-length numeric retail identifier. The table below details the precise engineering differences.
| Parameter | Code 128 | UPC-A |
|---|---|---|
| Character Set | Full 128 ASCII (all printable + control chars via Subsets A, B, C) | Numeric only (digits 0–9) |
| Data Capacity | Up to ~48 chars (Subset C) / ~30 chars (Subset B) per ISO label | Exactly 12 digits (11 data + 1 Mod-10 check digit) |
| Variable Length | Yes — symbology grows with payload | No — always exactly 95 modules wide |
| Checksum Algorithm | Modulo-103 (weighted sum of symbol values) | Modulo-10 (alternating x1 / x3 weights) |
| ISO Standard | ISO/IEC 15417 | ISO/IEC 15420 + GS1 General Specifications |
| Quiet Zone | 10 modules each side | 9 modules left / 7 modules right |
| Min Bar Height | 15% of barcode length or 5mm, whichever is greater | 69.24% of total width (~25.91 mm at 100% magnification) |
| Primary Use Case | Shipping labels, GS1-128 / SSCC, healthcare NPI | US/Canadian consumer retail point-of-sale |
The efficiency of Code 128 depends on its three character subsets. Subset A handles ASCII control characters (0x00–0x5F). Subset B covers printable ASCII (0x20–0x7F). Subset C is the most compact — it encodes two numeric digits per symbol character, halving the physical footprint for purely numeric payloads. Encoders automatically switch between subsets using START, CODE A/B/C, and SHIFT control characters.
A UPC-A symbol encodes a 12-digit GTIN-12: a 1-digit Number System Character (0–9, indicating product type), a 5-digit GS1 Company Prefix, a 5-digit Item Reference, and a 1-digit Modulo-10 check digit. The physical symbol is always 95 modules wide (3 guard bars + 42 numeric modules per half + 5 centre guard modules), making it one of the most dimensionally stable symbologies in use.
Industry Compliance
The GS1 General Specifications (currently v24.0) govern every barcode that enters a retail supply chain. They are not suggestions — non-compliant symbols are rejected by retailer receiving systems, which perform automated quality gates before product acceptance. The rules below are the most frequently violated.
Every GS1 company prefix (6-11 digits) must be licensed from your national GS1 Member Organisation. Using an unregistered prefix constitutes a violation of the GS1 System and will cause your product to be rejected by most major retailers.
GS1-compliant barcodes must be printed within 80%-200% of nominal size. At 80% the X-dimension is 0.264 mm; at 200% it is 0.660 mm. Printing below 80% makes the symbol unscannable with standard POS hardware.
The quiet zone is a mandatory white area surrounding the barcode. For EAN-13 and UPC-A it is 7x the X-dimension on the right and 11x on the left. Omitting it causes adjacent graphics to be read as part of the barcode, producing a misread.
Bars must be printed in a dark ink on a light background (reflectance difference > 37.5%). Red inks or warm tints reflect the POS scanner's red laser and produce the same signal as white space — the barcode becomes invisible to the scanner.
The OCR-B typeface below the symbol is mandated by GS1 General Specifications. It enables manual data entry during scanner failure and is required on all primary product packaging.
Glossy coatings can cause specular reflection that overloads scanner photodiodes. Matte or semi-matte finishes are preferred. UV-reactive inks used on some packaging may fluoresce and reduce contrast under scanner illumination.
Before entering the supply chain, symbols must be graded by an accredited verifier. The grading scale (4.0-0.0 / A-F) assesses: Minimum Reflectance, Symbol Contrast, Modulation, Defects, Decodability, and Decode. Retail target grade: 1.5 / C or better.
Hardware Troubleshooting
A barcode that renders perfectly on screen can fail in production for entirely different reasons. The following are the five root causes responsible for the majority of field failures, documented with precise engineering detail and actionable remediation steps.
A standard desktop laser printer outputs 300-600 DPI. At 300 DPI each dot is 0.085 mm. An X-dimension of 0.33 mm requires ~4 dots per module. If bar-to-space transitions fall between dot boundaries, bars gain 0.085 mm of ink bleed per edge — effectively fattening bars and shrinking spaces beyond the tolerance window.
Print thermal/laser at 600 DPI or higher for standard labels; use 203-300 DPI industrial thermal-transfer printers only with fonts calibrated to the print head pitch. Always verify with ISO/IEC 15416 before production runs.
Expert FAQ
Answers to the most technically substantive questions from engineers, print professionals, and retail operations teams using the barcode generator.
Code 128 has no fixed upper limit by specification, but practical label widths constrain it. Using Subset C (numeric pairs), you can encode approximately 48 digits in a standard 100 mm wide label at 0.33 mm X-dimension. Mixed alphanumeric content (Subset B) typically fits 30-35 characters in the same space. Encoding very long strings produces a physically wide barcode that is impractical to print and scan.
This node has been audited for mathematical precision and memory isolation by the MyUtilityBox engineering team. All logic executes locally in browser V8 to ensure zero data leakage. Last Verified: April 2026.