Barcode Studio

Code 128 Barcode Generator

Create Code 128 barcodes for inventory, logistics, shipping labels, warehouse systems and general alphanumeric identification.

Data Matrix PDF417 Code 128 Code 93 EAN-13 EAN-8 UPC-A ISBN Code 39 ITF-14 MSI Plessey Pharmacode Codabar

Barcode & Matrix Generator

Live Studio Preview
Invalid input format for selected symbology.
SMART BARCODE INTELLIGENCE
Analyzing barcode...
-- /100 SCAN READY
RECOMMENDED FORMAT Analyzing...
BEST FOR —
DATA RULES —
CHECK DIGIT —
CONTRAST —
Analyzing barcode data...
PROFESSIONAL EXPORT STUDIO
Export your barcode Choose a professional format and output resolution.
HIGH RES
PNG · 1024 px · Current background

Code 128 Batch Serial Number Generator

Generate sequential Code 128 barcodes for warehouse SKUs, asset tags, inventory labels, and other internal identifiers.

Configure your sequence above and click generate to build batch items.
BARCODE KNOWLEDGE STUDIO

Code 128 Barcode Generator

Quick answer: Code 128 is a variable-length linear barcode defined in ISO/IEC 15417:2007. It encodes all 128 ASCII characters across three code sets: A, B and C. Code Set C encodes digit pairs in a single codeword, compressing numeric data to roughly half the physical length of Code Sets A and B.

Runs in your browser Standards-aware formats Batch serial mode SVG, PNG, WEBP, JPG

How to create a Code 128 barcode

  1. Enter the data you want to encode — letters, digits, punctuation or any ASCII character including lowercase letters and control characters.
  2. Select the output size: choose PNG at 512, 1024, 2048 or 4096 pixels for digital use, or SVG for fully scalable print output.
  3. Set the bar height if your label specification requires a specific height, or leave it at the default for automatic sizing.
  4. Preview the barcode in the live studio and verify the human-readable text below the bars matches your data.
  5. Download and apply to your label template.

For a numbered sequence — inventory tags, asset stickers, warehouse location markers — use the Batch Serial Number Generator. Enter a prefix, a starting number and a quantity up to 50 and preview the sequence and download each PNG individually.

The generator runs entirely in your browser. Nothing you type is sent to any server.

What a Code 128 barcode is

Code 128 is a one-dimensional, variable-length barcode symbology defined in ISO/IEC 15417:2007, with Amendment 1 published in 2026. It is the most widely used alphanumeric linear barcode in warehouse, logistics and shipping applications globally.

The symbology encodes all 128 characters of the ASCII character set — digits, uppercase letters, lowercase letters, punctuation and non-printable control characters — across three internally switchable code sets. The switch between code sets happens inside the symbol without any visible break; the reader handles it transparently.

Each character is represented by 6 elements: 3 bars and 3 spaces. Each element is 1 to 4 modules wide, giving 11 modules per character. For numeric data, Code Set C uses a different assignment table where each codeword represents a two-digit pair rather than a single character. This halves the number of codewords needed for a purely numeric string, which is why long numbers such as container serial codes and parcel tracking numbers can be printed at a much smaller physical length in Code 128 than in Code 39.

Code 128 technical specification

Code sets and character coverage

Code SetCharacters encodedDensity
AASCII 0–95 (control chars, digits, uppercase)Standard
BASCII 32–127 (full printable + DEL, lowercase included)Standard
CDigit pairs 00–99 (each pair in one codeword)2× numeric density

The encoder automatically selects and switches between code sets to produce the most compact symbol for any given input. A mixed alphanumeric string may use Code Set B for the letters and switch to Code Set C for a long numeric run within the same symbol.

Check character and structure

ParameterValueSource
StandardISO/IEC 15417:2007 (Amd 1:2026)iso.org/standard/43896.html
Element count per character6 (3 bars + 3 spaces); stop: 7 elementsISO/IEC 15417:2000 §4.1(c)
Modules per character11 (5.5 per numeric digit in Code Set C)tec-it.com Code 128 knowledge base
Check characterMandatory — one symbol check characterISO/IEC 15417:2000 §4.1(g)
Check digit algorithmModulo-103 weighted sum: start character value + sum of (each character value × position), all mod 103ISO/IEC 15417:2000 §4.1(g)
Symbol lengthVariable (no practical limit defined; GS1-128 caps at 48 data characters)ISO/IEC 15417:2007 §4.1(e)
Bidirectional decodeYesISO/IEC 15417:2007
Character setAll 128 ASCII (0–127); extended to 255 via FNC4 pairsISO/IEC 15417:2000 §4.1(a)

GS1-128

GS1-128 is a specific application of Code 128 defined by the GS1 organisation. It uses standard Code 128 with one mandatory addition: FNC1 (Function Code 1) is inserted immediately after the start character. FNC1 identifies the symbol as a GS1-128 barcode and signals that the data payload is structured as one or more GS1 Application Identifiers (AIs).

GS1 Application Identifiers are two- to four-digit codes that identify the meaning of the data that follows. AI (01) identifies a GTIN, AI (17) identifies an expiry date, AI (10) identifies a batch or lot number, AI (21) identifies a serial number. A single GS1-128 barcode on a pharmaceutical shipping case can carry the GTIN, batch number, expiry date and serial number all at once.

GS1 specifies additional constraints for GS1-128 symbols in general distribution: the minimum module width is 0.495 mm, the maximum data length is 48 data characters per symbol, and the maximum physical symbol length including quiet zones is 165.1 mm.

When to use a Code 128 barcode

Warehouse inventory labels. Code 128 is the standard for internal SKU labels, asset tags and bin location markers. Any alphanumeric combination — part numbers, location codes, serial numbers — is supported at high density and readable with any modern barcode scanner without configuration.

Shipping and carrier labels. Courier and carrier systems worldwide use Code 128 for tracking numbers, route codes and service indicators. Amazon FBA FNSKU labels, which identify a seller's product in the Amazon fulfilment network, use Code 128.

GS1-128 for pharma and food supply chains. The pharmaceutical and food industries use GS1-128 on shipping cases and pallets to carry GTIN, batch, expiry and serial information in a single scannable symbol. GS1-128 is a mandatory or strongly recommended symbology in GS1 General Specifications for case-level labelling.

Healthcare asset tracking. Hospitals use Code 128 on equipment asset tags, medical supply labels and sample tubes. The full ASCII support means accession numbers and location codes with mixed alphanumeric content encode without character restrictions.

Internal serialisation. Any operation that needs a running sequence of labels — production lots, tooling identifiers, calibration records — can use Code 128 with the Batch Serial Number Generator to produce a complete set in one session.

Print requirements for Code 128

X-dimension. The X-dimension is the width of the narrowest bar or space. For general warehouse scanning, a minimum X-dimension of 0.25 mm is typical. GS1-128 for general distribution specifies a minimum of 0.495 mm per GS1 General Specifications.

Bar height. The bar height should be at least 15 percent of the symbol length excluding quiet zones, or 5 mm, whichever is greater. A taller bar height improves tolerance for label skew and scanner tilt.

Quiet zones. Code 128 requires a minimum quiet zone of 10X on both the left and right sides of the symbol. Any art, text, or border that encroaches on this space will cause the scanner to miss the start or stop character.

Print contrast. The bars must be significantly darker than the spaces. High-contrast black-on-white is reliable. Coloured bars on coloured backgrounds are a scanning risk — most laser scanners use a red beam that does not distinguish red from white, making red bars on white invisible.

Aspect ratio. Code 128 is a 1D linear barcode. Scale it uniformly. Stretching the symbol horizontally changes module widths; compressing it vertically reduces bar height below the minimum. Both changes increase scan failure rates.

Batch serial number generator for Code 128

The Batch Serial Number Generator is the strongest commercial feature on this page for warehouse managers, small manufacturers and fulfilment operations. It produces up to 50 sequential Code 128 barcodes in a single pass.

Example: a small manufacturer needs to label 30 units of a new product for the first production run. Set prefix to "PROD-A-", starting number to 0001, suffix empty and quantity to 30. The generator produces PROD-A-0001 through PROD-A-0030 as individual Code 128 symbols, each with the correct modulo-103 check character, ready to download and send to a label printer.

No competitor's free browser tool offers this. Most tools require separate manual entry for each barcode or a paid plan to unlock batch generation.

Troubleshooting: why your Code 128 barcode is not scanning

Lowercase characters not accepted. If you are using Code 128 via a system that only supports Code Set A, lowercase letters, tilde and accented characters will fail to encode. Switch to Code Set B or use the generator's automatic code set selection.

Check digit error. The modulo-103 check character is calculated by the generator and embedded in the symbol. If you are manually constructing a Code 128 barcode string and hand-writing the check character, any arithmetic error produces an invalid symbol. Use the generator to let it calculate the check character correctly.

Bar height too short for the scanner angle. A barcode reader held at a steep angle may miss the bars because the scan beam exits the bar area before completing a full scan. Increase bar height or hold the scanner more perpendicular to the label.

Quiet zone violated. If the label design places text, borders or other elements within 10X of the start or stop character, the scanner cannot find the symbol edges. Move all design elements outside the quiet zone.

Non-uniform scaling. Code 128 exported as PNG must be printed at exactly the pixel dimensions specified, or scaled uniformly. Printing an image at a different DPI than intended changes module widths.

Wrong symbology enabled on the scanner. Most modern scanners read Code 128 by default, but some low-cost fixed-mount scanners ship with only EAN/UPC enabled. Check the scanner's configuration sheet.

Code 128 versus Code 39

Code 128 (ISO/IEC 15417:2007) and Code 39 (ISO/IEC 16388:2023) are the two most common alphanumeric linear barcodes. They are not interchangeable.

Code 128Code 39
StandardISO/IEC 15417:2007ISO/IEC 16388:2023
Character setAll 128 ASCII (uppercase, lowercase, digits, punctuation, control chars)43 characters (uppercase A–Z, digits 0–9, 7 special)
Lowercase supportYes (Code Set B)No — full ASCII requires two-character shift sequences
Numeric densityDouble-density in Code Set C (digit pairs)Standard density only
Check characterMandatory modulo-103 (auto-calculated)Optional modulo-43
Symbol typeContinuousDiscrete (intercharacter gaps)
Physical densityHigher — shorter symbol for equivalent dataLower — longer symbol for equivalent data

Code 128 is the correct choice for any new application. Code 39 should be used only when a legacy system specifically requires it or when a regulation (US DoD LOGMARS, automotive) mandates Code 39. For everything else — warehouse, shipping, inventory, healthcare — use Code 128.

What this Code 128 Barcode Generator gives you

This browser-based generator creates a dense general-purpose linear barcode with automatic code-set selection. It is intended for warehouse stock, shipping references, assets and mixed-character identifiers. Input validation checks the basic length and character rules of the selected symbology while the live preview lets you review the human-readable value and overall proportions before export.

The studio provides practical controls for barcode height, scale, foreground and background colour, transparent output and human-readable text. Download options include SVG for professional print and high-resolution PNG, WEBP or JPG for documents and digital workflows. Batch mode can prepare sequential internal labels, but it does not create database records or allocate regulated identifiers.

Barcode generation happens in the browser, so the value does not need to be uploaded to draw the symbol. A technically valid image is not the same as a verified production label: test the exported artwork with the intended scanner, printer, substrate, software and receiving workflow.

Using this barcode in Bahrain and international supply chains

Bahrain retailers, importers, manufacturers and logistics teams should match identifiers to the rules of their trading partners. Retail GTINs must come from the proper issuing organisation; a generator creates artwork but does not assign ownership. Internal stock and asset references may use organisation-defined values when the receiving system supports them.

Use British English in operational guidance where it matches your organisation’s style, and add Arabic instructions for teams that need them. Print under the actual conditions of use. Bahrain’s heat, bright light, dust, curved packaging and reflective laminate can expose contrast or surface problems that are invisible on a monitor.

Keep quiet zones clear, avoid stretching the image, and prefer dark bars on a plain light background. Scan samples from the beginning, middle and end of a print run. For regulated retail, healthcare, publishing or logistics use, confirm the current GS1, ISBN-agency, customer or industry specification before approving production.

PRODUCTION CHECKLIST

Before you print

  • Correct symbology selected
  • Identifier ownership confirmed
  • Check digit verified
  • Quiet zones kept clear
  • Strong bar contrast
  • Aspect ratio unchanged
  • SVG or high-resolution PNG
  • Production scanner test
Return to generator ↑
BARCODE FAQ

Frequently asked questions

Open a question to read a concise technical answer.

01What is a Code 128 barcode?+

Code 128 is a variable-length linear barcode defined in ISO/IEC 15417:2007. It encodes all 128 ASCII characters across three code sets: A (control characters and uppercase), B (full printable ASCII including lowercase) and C (digit pairs at double density). One mandatory modulo-103 check character is calculated automatically. Code 128 is the standard symbology for warehouse, shipping and logistics labels.

02What characters can Code 128 encode?+

Code 128 encodes all 128 ASCII characters (values 0–127), including uppercase and lowercase letters, digits, punctuation and non-printable control characters. Code Set B covers the full printable ASCII range including lowercase letters. Extended characters (values 128–255) are available via FNC4 pairs.

03What is Code Set C in Code 128?+

Code Set C encodes consecutive digit pairs in a single codeword. A 12-digit number such as a GTIN or parcel tracking number occupies 6 codewords in Code Set C compared to 12 in Code Set A or B. This roughly halves the physical length of a purely numeric symbol, which is why long tracking numbers fit on small labels without reducing the X-dimension.

04How is the Code 128 check digit calculated?+

The check character is a mandatory modulo-103 weighted sum. The calculation adds the numerical value of the start character to the sum of each subsequent character's value multiplied by its position number, then takes the remainder when divided by 103. The generator calculates this automatically — users never need to compute it manually.

05What is GS1-128?+

GS1-128 is Code 128 with a mandatory FNC1 character inserted immediately after the start character. FNC1 identifies the symbol as GS1-128 and signals that the data follows GS1 Application Identifier (AI) structure. AIs encode data type: (01) for GTIN, (17) for expiry date, (10) for batch number, (21) for serial number. GS1-128 is required or recommended on pharmaceutical and food shipping cases in GS1 supply chains.

06What is the maximum length for a Code 128 barcode?+

The ISO/IEC 15417:2007 standard does not define a practical maximum symbol length. GS1-128 imposes an application limit of 48 data characters per symbol and a maximum physical length of 165.1 mm including quiet zones, per GS1 General Specifications. For internal use, the practical limit is determined by label space and the scanner's field of view.

07Can Code 128 encode lowercase letters?+

Yes. Code Set B includes the full printable ASCII range (values 32–127), which covers lowercase a–z. Code Set A does not include lowercase letters. The generator uses automatic code set selection, so lowercase characters trigger Code Set B automatically.

08Do I need Code 128 or Code 39 for my warehouse labels?+

Use Code 128. Code 128 encodes all 128 ASCII characters including lowercase letters and is more compact for equivalent data. Code 39 encodes only 43 characters, does not natively support lowercase, and produces longer symbols for the same data. Code 39 is appropriate only when a legacy system or a specific regulation requires it.

09Is Code 128 used for Amazon FBA labels?+

Amazon FBA FNSKU labels use Code 128. The FNSKU is an alphanumeric identifier assigned by Amazon; Code 128's full ASCII support and high density make it the natural fit. The generator here produces standard Code 128 symbols — confirm Amazon's current label specifications before printing.

10Does Code 128 need a GS1 licence?+

No, for internal use. Code 128 encodes arbitrary data without any licensing requirement. A GS1 licence is only required when the encoded data includes a GS1-licensed GTIN for retail sale. Internal inventory codes, asset tags, shipping references and location labels require no registration.