Code 128 Barcode Generator

Make a Code 128 barcode online for free. Type any text, numbers or symbols: the generator picks code sets A, B and C to keep the barcode as short as possible, shows which sets it used and how many modules wide the symbol is, and lets you force one set. Download SVG, PNG, PDF or EPS.

Valid

58.1 × 19.4 mm at 300 DPI

Barcode

12 characters

Any ASCII text.

Code 128 options

Size and resolution

Output DPI

300 DPI · Thermal / offset

4 px per module at 300 DPI. Print size: 58.1 × 19.4 mm (2.29 × 0.77 in). PNG, WebP and JPEG: 704 × 236 px.

Human-readable text

Text size and alignment

Alignment

Text font

FontNew

Label textNew

Font

Alignment

Printed in the file with the barcode, outside the quiet zone, in Helvetica or Courier so it looks the same in every format.

Colors

Contrast 21.0:1; estimated symbol contrast 100%.

Quiet zone (modules)2 · 10 · 2 · 10

Bar width reduction0 mil

Makes each bar thinner by this amount, to make up for ink that spreads on paper. Ask your printer for the value, or leave 0 for laser and thermal printing.

Rotation and backgroundNew0° · Filled

Rotation

In the preview, a checkered pattern shows the transparent areas. Print a transparent barcode only on a white or very light surface: scanners need the light quiet zone around it.

Margin and borderNew0 mm · no border

The margin is blank space outside the quiet zone, for cutting; the border is drawn at the outer edge. Both count in the print size.

Data inspectorNew12 chars
PresetsNew0 saved

No presets yet. Save the current settings to reuse them.

    Presets stay in this browser. They keep the type, size and style; the data and the logo are not saved.

    Recent barcodesNew0

    The barcodes you download appear here, newest first.

      The last 10 downloads, kept in this browser only.
      Code 128 · Live previewValid
      Code 128 barcode encoding BC-2026-0042
      New

      Scaled to fit. Actual size shows the print size on screen.

      Print simulationNew

      Shows how a worn print looks and tests it with the decoder.

      Type
      Code 128 · 1D
      Print size
      58.1 × 19.4 mm
      Raster
      704 × 236 px
      Modules
      156 wide

      Download

      Vector drawing, 58.1 × 19.4 mm. Design and label programs place it at its print size.

      New
      More export optionsNewTest sheet · size set · embed code

      Print test sheet (PDF)

      The code at 80%, 100% and 150% with 100 mm and 4 in rulers. Print it at actual size and scan each copy before printing many.

      Size set (ZIP)

      Magnification

      Embed code

      Nothing you type is uploaded.New

      How to Create a Code 128 Barcode

      Type your data, check the code sets and size under the field, and download the file.

      1. Type the text, number or code you want to encode, such as an order or asset number.
      2. Read the line under the options: it lists the code sets used and the symbol width in modules.
      3. Set the X-dimension and bar height for your printer and label, then check the print size.
      4. Download SVG, PNG, PDF or EPS and scan a test print before printing a batch.

      Code 128 Code Sets: A, B and C

      Code 128 has three code sets, and a symbol can switch between them to encode each part of the data in the fewest characters.

      The Three Code Sets

      • Code set A: capital letters, digits, punctuation and the control characters (ASCII 0 to 95).
      • Code set B: capital and lowercase letters, digits and punctuation (ASCII 32 to 127).
      • Code set C: pairs of digits from 00 to 99, so numbers take half as many characters.

      Special Characters

      • Code A, B and C: switch the code set for the rest of the symbol.
      • Shift: switches between A and B for a single character.
      • FNC1: in the first position marks GS1 data, as in GS1-128.
      • FNC4: reaches Latin-1 characters such as ä and é.

      Code 128 Specifications

      These are the rules of the Code 128 symbology as described in the GS1 General Specifications and the encoder's reference.

      Code 128 at a glance
      PropertyCode 128
      DigitsVariable length; digits pack two to a symbol character in code set C
      CharactersAll 128 ASCII characters (code sets A and B), Latin-1 characters 128 to 255 through FNC4, and digit pairs 00 to 99 (code set C)
      Check digitOne mandatory check character: start value plus each symbol character's value times its position, modulo 103; it is not printed in the text
      Quiet zone10 modules left, 10 modules right
      Symbol characters11 modules each (three bars and three spaces); the stop character is 13 modules
      Function charactersFNC1 in first position marks GS1 data; FNC2 appends messages, FNC3 programs readers, FNC4 reaches Latin-1
      StandardISO/IEC 15417; GS1-128 is Code 128 with FNC1 and GS1 Application Identifiers
      Where the numbers come fromYour own data; GS1 data such as GTINs and batch numbers belongs in GS1-128
      ExampleBC-2026-0042

      GS1 General Specifications §5.4.1 and §5.4.3 (code sets, special characters, check character), quiet zone from symbol specification table 2 (table 5-47) for GS1-128; BWIPP Code 128 reference (Latin-1 through FNC4).

      Sources, checked 2026-10-04: GS1 General Specifications, Release 26.0 (ratified January 2026); Code 128 reference (BWIPP, the encoder bwip-js implements).

      Code 128 Barcode Examples

      The examples below show how this generator encodes different data, measured with its own encoder.

      How this generator encodes four examples (start and check characters included, stop and quiet zones excluded)
      DataCode sets usedSymbol charactersWidth in modules
      BC-2026-0042B: BC-2026- · C: 004213156
      0123456789C: 0123456789790
      Order 12345678B: Order · C: 1234567813156
      Size: S/M/LB: Size: S/M/L13156

      Why Numbers Make Shorter Barcodes

      In code set C each symbol character carries two digits, so ten digits need only five data characters. That is why 0123456789 takes 90 modules while the 12-character BC-2026-0042 takes 156.

      Forcing One Code Set

      Some systems expect a particular code set. Choose A, B or C under Code set to draw the whole symbol in one set; the generator explains when a set cannot encode the data, such as an odd number of digits in code set C.

      Code 128 vs Code 39

      Code 128 encodes all of ASCII and packs digits in pairs, while standard Code 39 covers capital letters, digits and seven symbols in wider characters.

      Code 128 vs Code 39 the full comparison: characters, width, check characters and when to use each.

      Frequently Asked Questions

      Is This Code 128 Generator Free?

      Yes. There is no account, watermark or download limit, and the barcodes may be used commercially.

      Does the Generator Add the Check Character?

      Yes, always. Code 128 requires a check character, calculated with modulo 103, and it is not printed in the text under the bars.

      Can Code 128 Encode Lowercase Letters?

      Yes. Code set B includes lowercase letters, and the generator switches to it whenever the data needs it.

      What Is the Difference Between Code 128 and GS1-128?

      GS1-128 is Code 128 with an FNC1 character at the start and data written with GS1 Application Identifiers. Use GS1-128 for GTINs, batch numbers and dates that trading partners read.

      Can I Use a Code 128 Font Instead?

      A font cannot pick code sets or add the check character by itself, so it needs extra software to work. An image or SVG from this generator is a complete, valid symbol.

      How Long Can a Code 128 Barcode Be?

      The generator encodes as much data as you type, but long symbols get wide. Keep the data short, or use a 2D code such as Data Matrix for long text.