Code 128
Generate Code 128 barcodes for warehouses and inventory
Inventory numbers, storage locations, serial numbers or job tickets don’t need an official GS1 number. Code 128 is the first choice here: it handles letters and digits, is compact and is read by practically every scanner. Here is how it works and when another type fits better.
Enter text or a number, pick a size, done: the Barcode Generator creates Code 128 one at a time or as whole label sheets – free and with no upload.
Create a Code 128The short version
- In the Barcode Generator, choose Code 128.
- Enter a number or text – letters, digits and symbols are allowed.
- For many codes use “Sequence”, e.g. starting at
INV-0001. - Save as SVG, PDF, PNG or straight onto a label sheet.
What Code 128 can do
Code 128 can encode all 128 ASCII characters – upper and lower case letters, digits, punctuation and control characters; with a shift character also Western European characters such as accented letters. Internally it switches between three code sets:
| Code set | Content | Note |
|---|---|---|
| A | Capital letters, digits, control characters | for legacy systems |
| B | Upper and lower case letters, digits, symbols | the usual choice for text |
| C | Digits only | two digits per character – very compact |
You don’t have to deal with code sets: the generator automatically picks the shortest combination. The check character (modulo 103) is calculated automatically too; it is hidden in the barcode and not shown in the text.
Tip: purely numeric content with an even number of digits gets especially short. 00012345 makes a shorter code than INV-12345.
Code 128, Code 39, EAN or DataMatrix?
| Type | Content | Good for | Not for |
|---|---|---|---|
| Code 128 | Text and digits | Inventory, warehouses, internal numbers | Retail products |
| Code 39 | Capital letters, digits, a few symbols | Systems that explicitly require it | Long content – the code gets very wide |
| EAN-13 | 13 digits (GTIN) | Retail products | Internal numbers |
| GS1-128 | GS1 data with application identifiers | Shipping, batch, expiry date | Free text |
| DataMatrix | Any text, 2D | Very little space | Laser scanners without 2D support |
Code 39 is older and needs considerably more width for the same content. It is only worth it if existing software or a customer explicitly requires it.
Generate inventory numbers from INV-0001 to INV-0500 and print them straight onto a label sheet.
Step by step
- Type. In the Barcode Generator, click Code 128.
- Content. For example
INV-0042. The euro sign and characters outside the Western European character set are not possible – the generator tells you. - Size. Module width 0.25–0.5 mm, bar height at least 15% of the width or 6.35 mm. The total size is shown below the inputs.
- Check. The readability check reads the code back in your browser and warns e.g. about short bars or unsuitable colors.
- Many codes. Under “Batch & labels”, paste a list or number sequentially and save as ZIP or label sheet.
Size and printing
- Module width: 0.25 mm works with a good laser printer, 0.33 mm or more is more robust. On 203 dpi thermal label printers, multiples of 0.125 mm are ideal (0.25 / 0.375 / 0.5 mm).
- Quiet zone: keep at least 10 modules free on the left and right. The generator includes it by default.
- Length: every character costs 11 modules. Long text means wide codes – encode a short number instead and print the description next to it.
- Colors: dark bars on a light background; no red, orange or yellow bars.
Typical uses
Inventory
Every device gets a number like INV-0042 – stocktaking with a scanner or phone app instead of copying numbers.
Storage locations
Aisle, shelf and level as A-03-2. Pickers scan the location to confirm.
Orders and documents
Print the order number on job tickets, delivery notes or work orders – one scan opens the record.
Libraries and rentals
Media and member card numbers for clubs, schools or tool libraries.
Create your Code 128
One at a time or hundreds at once, as SVG, PDF, PNG or label sheet – with readability check, free and with no upload.
Frequently asked questions
Is the Code 128 generator free?
Yes, with no sign-up, no watermark and no limit – including label sheets and ZIP exports.
Which characters can Code 128 encode?
All ASCII characters – upper and lower case letters, digits and symbols – plus Western European characters such as accented letters. The euro sign is not included.
Do I need a GS1 number for Code 128?
No. Code 128 is meant for internal numbers. Only retail products (EAN) and GS1-128 with GTIN or SSCC need GS1 numbers.
Which is better: Code 128 or Code 39?
Code 128 in almost all cases – it is more compact and supports more characters. Use Code 39 only if a system explicitly requires it.
Does Code 128 have a check digit?
Yes, a modulo 103 check character. It is calculated automatically and not shown in the text.
Can I scan Code 128 with my phone?
Yes. Many camera apps and practically all barcode scanner apps read Code 128.
Sources
- Barcode Writer in Pure PostScript and bwip-js – the open-source libraries the generator uses to draw the codes.
- ZXing – the open-source decoder behind the readability check.