Code 128 Generator

Create ordinary Code 128 barcodes from printable ASCII text. The barcode is generated in your browser and can be downloaded as PNG, JPG, SVG or PDF.

Barcode type

This page creates barcodes of this type.

Code 128

Barcode value

Printable ASCII characters, up to 80 characters. Spaces are kept as typed.

Options

Choose how the barcode appears in the preview and in downloads.

Barcode preview

The preview shows the barcode at its module geometry. Test printed barcodes with the scanner you plan to use.

Enter a value to see the barcode here.

Export & Download

PNG and SVG keep bar edges sharp. JPG is a compression format, offered for compatibility. Use PNG where crisp edges matter.

How to create a Code 128 barcode

Enter the text

Type the text or code to encode. Printable ASCII characters are accepted, up to 80 characters.

Check the value

Spaces are kept as typed. Unsupported characters are reported with their position, not replaced.

Choose the output

Show or hide the value under the bars, then choose PNG, JPG, SVG or PDF.

Download or share

Download the file, or share the PNG where your device supports it.

What this Code 128 generator does

Creates ordinary Code 128 barcodes from printable ASCII text, entirely in your browser.

Printable ASCII text

Letters, digits, spaces and common symbols, from space to tilde.

Automatic checksum

The Code 128 checksum is calculated for you. You do not enter it.

Clear validation

Characters that cannot be encoded are rejected with their position, rather than replaced.

Four download formats

PNG, JPG, SVG and PDF, each built from the same barcode geometry.

Other barcode types

Code 128 suits text and internal codes. Product-number formats have their own pages.

Barcode Generator

The general generator also offers EAN-13, UPC-A and EAN-8 on one page.

UPC-A

A 12-digit product-number format. Use it only where your system requires UPC-A.

EAN-13

A 13-digit product-number format used on retail products.

How Code 128 works

Code 128 is a high-density barcode. This generator produces ordinary Code 128 using Code Set B, and the points below describe exactly what it does.

Code Set B

This implementation uses Code Set B. It encodes printable ASCII characters from space (32) to tilde (126). Code Sets A and C are not offered.

Printable ASCII only

Control characters and non-ASCII characters, such as accented letters, are rejected rather than replaced. Digits are encoded like any other character.

The 80-character limit

fourwww limits the input to 80 characters on this page. This is a limit of this tool. It is not a limit of the Code 128 standard.

Code 128 and GS1-128

This is ordinary Code 128. GS1-128 uses FNC1 and application identifiers to structure data. This generator provides neither, so it does not create GS1-128 barcodes.

Check the format that the scanning system expects, including upper and lower case and any prefixes, before you print.

Printing and scanning a Code 128 barcode

Each character makes a Code 128 barcode wider. Long values need more print width and careful scanner testing.

Keep the quiet zones clear

Leave clear space at both ends of the barcode, free of other content.

Watch the width

If a long value must fit a narrow space, shorten the value rather than stretching the barcode.

Preserve the proportions

Scale the file uniformly. Distortion makes bars harder to read.

Test long values

Print and scan the longest value you will use, with the device and software of your workflow.

Check size requirements

This tool does not apply print-size rules. Confirm the requirements of the system that will read the barcode.

Frequently asked questions

What is ordinary Code 128?

Standard Code 128 without GS1 application identifiers. This page creates that format.

Why is there an 80-character limit?

fourwww sets the limit for this tool. The Code 128 standard does not define it.

Can I create GS1-128 barcodes here?

No. GS1-128 uses FNC1 and application identifiers, which this generator does not provide.

Why is my accented letter rejected?

Code Set B covers printable ASCII only. Characters such as é are outside this set, so they are rejected rather than replaced.

Can I share the barcode?

On devices with file sharing, Share PNG passes the PNG file to the share sheet. The value is not included as text.