If you need a barcode for inventory, internal product codes, asset tags, warehouse labels, or simple tracking, Code 128 is one of the most flexible one-dimensional barcode formats because it can encode letters, numbers, and symbols in a compact space.
AiNowly’s Barcode Generator lets you create Code 128 and EAN barcodes in the browser and download the result as a PNG. The important part is knowing which barcode type fits your use case and when a generic Code 128 barcode is different from a standards-based GS1 barcode.
Quick answer: how to generate a Code 128 barcode online free
- Open the AiNowly Barcode Generator.
- Select Code 128.
- Enter the text or number you want to encode.
- Generate the barcode.
- Download the PNG.
- Print a test copy at the real size you plan to use.
- Scan the physical print with the scanner or app that will be used in production.
Do not skip the print test. A barcode that scans perfectly on a bright monitor can fail after being printed too small, blurred, stretched, or placed on low-quality material.
Code 128 barcode generator online free: why Code 128 is popular
Code 128 is a high-density linear barcode family designed to encode a broad range of characters. It is widely used in internal logistics, warehousing, inventory, shipping, asset tracking, and labels because it can represent more than just numeric data.
Searches for a Code 128 barcode generator online free usually come from people who already know they need a barcode image and want a fast result. The best workflow therefore needs to answer three things quickly: what data can be encoded, how to keep it scannable, and whether the barcode must follow a formal industry standard.
Code 128 vs EAN: which one should you use?
Use Code 128 when you need flexible alphanumeric data such as internal SKUs, serial-like values, warehouse IDs, asset labels, or mixed letters and numbers.
EAN barcodes are more closely associated with retail product identification and use fixed numeric structures. If you are creating a barcode for a product that must work in retail point-of-sale systems, you should not invent an EAN number randomly. Retail identifiers often need to be issued and managed according to GS1 rules.
For internal labels that only your own organization scans, Code 128 is often the more flexible choice.
Code 128 vs GS1-128: they are not the same thing
This distinction matters. GS1 explains that GS1-128 is a special version of Code 128 used with GS1 data structures. GS1-128 includes a special FNC1 character after the start character and uses GS1 Application Identifiers to define the meaning of the encoded fields.
A generic Code 128 barcode generated from arbitrary text is therefore not automatically a GS1-128 barcode, and it is not automatically suitable for regulated supply-chain labeling.
If a trading partner, carrier, retailer, hospital, distributor, or logistics specification tells you to use GS1-128, follow the relevant GS1 specification rather than treating any Code 128 image as equivalent.
What can you put inside a Code 128 barcode?
Typical internal uses include:
- Inventory item IDs.
- Warehouse bin locations.
- Asset tag numbers.
- Internal product SKUs.
- Order references.
- Employee or equipment IDs.
- Shipping workflow references.
- Batch references used only inside your own system.
Keep encoded values as short as reasonably possible. More data creates a wider barcode, which can make printing and scanning more demanding.
How to make a barcode that actually scans
Generating the pattern is only half the job. Scan reliability depends heavily on the physical output. Follow these rules:
- Use dark bars on a light background.
- Do not stretch the barcode disproportionately.
- Leave clear empty space on the left and right.
- Do not crop the start or stop areas.
- Print at sufficient resolution.
- Avoid glossy reflections when possible.
- Keep the bars crisp instead of blurred.
- Test with the real scanner and label material.
The empty margins around a linear barcode are often called quiet zones. Standards-based barcode specifications define space around the symbol because scanners need a clean transition before and after the encoded bars.
What is a quiet zone in a barcode?
A quiet zone is the blank area around a barcode. GS1’s description of GS1-128 explicitly includes leading and trailing quiet zones as part of the symbol structure.
Even when you are creating a simple internal Code 128 label rather than GS1-128, the practical lesson is the same: do not place text, borders, icons, or other graphics directly against the barcode bars.
Should you show the human-readable text under the barcode?
For many workflows, yes. Printing the encoded value underneath gives people a fallback if the barcode cannot scan. It also makes it easier to visually verify that the label belongs to the expected item.
For internal inventory labels, a human-readable SKU beneath the barcode can save time when a scanner fails or the label is damaged.
How large should a Code 128 barcode be?
There is no single size that fits every data length and printing environment. The width depends on how much data is encoded, bar width, scanner distance, printer resolution, and the application.
Avoid shrinking a long Code 128 symbol until the bars become hair-thin. Instead, shorten the encoded value where possible, use adequate label width, and test the result physically.
For formal GS1 use, follow the X-dimension and size specifications in the relevant GS1 standard rather than relying on a generic visual estimate.
PNG vs SVG for barcodes
SVG is attractive for print because it is vector-based and scales without raster blur. PNG is convenient and broadly compatible with documents, labels, websites, slide decks, and many office workflows.
AiNowly currently provides a PNG barcode workflow. For typical internal labels, a sufficiently large PNG can work well. Do not take a tiny barcode PNG and enlarge it dramatically in a document editor, because interpolation can soften the edges.
How to use Code 128 for inventory labels
A simple inventory system can work like this:
- Create a unique internal SKU or asset ID.
- Store that same value in your inventory software or spreadsheet.
- Generate a Code 128 barcode from the exact value.
- Print the barcode with the value written underneath.
- Attach the label to the item or bin.
- Scan and verify that the returned value matches your system.
The barcode does not contain the entire inventory database. It usually acts as a compact machine-readable key that your software uses to look up the item.
Can you make a barcode for a product and sell it in stores?
This is where many free-barcode guides become misleading. Creating a barcode image does not automatically create a valid retail product identity.
If you need a barcode for a product sold through retail channels, marketplaces, distributors, or trading partners, check the identifier requirements. GTINs and GS1 retail barcode workflows have formal rules. A random EAN-looking number can collide with identifiers that belong to someone else or be rejected by a partner.
Use a generic generator for internal codes when appropriate; use the relevant GS1 process when standards compliance is required.
Code 128 for shipping labels
Code 128 is common in logistics, but shipping companies can require specific barcode formats, field structures, dimensions, or label templates. Do not replace an official carrier barcode with a homemade one.
Use your own Code 128 for internal warehouse references, then let the carrier system produce its required shipping label.
Code 128 for healthcare: be careful
Healthcare barcode use can involve regulated standards, traceability requirements, medication identification, and patient-safety workflows. A generic online barcode should not be treated as a standards-compliant medical identifier.
GS1 provides specific healthcare and distribution standards. If the barcode enters a regulated workflow, follow the required standard and validation procedures.
Why barcodes fail after printing
Low printer resolution
Bars become uneven or merge together.
Scaling after export
Dragging the image wider or narrower can distort bar proportions.
Low contrast
Colored bars on a patterned or dark background reduce readability.
Damaged quiet zones
Nearby text, borders, or cropping can interfere with scanner detection.
Too much encoded data
A long value creates a wide symbol that gets squeezed into a small label.
Bad label material
Gloss, wrinkles, curved surfaces, or poor adhesion can reduce scan reliability.
Can a phone scan Code 128?
Many barcode-scanning apps and camera libraries can read Code 128, but built-in phone camera behavior varies. If your real workflow uses a dedicated handheld scanner, test with that hardware rather than assuming a phone test is sufficient.
Can Excel generate Code 128?
Excel can participate in barcode workflows through fonts, add-ins, formulas, or external label systems, but those setups can be surprisingly easy to misconfigure. If you only need a single barcode image, an online generator is faster.
For hundreds or thousands of labels, use a structured batch workflow and verify that the barcode data matches your spreadsheet or database values.
Barcode generator checklist
- Choose the right barcode type.
- Use a unique, accurate value.
- Keep adequate quiet zones.
- Do not distort the image.
- Use strong black-on-white contrast where possible.
- Print a real test label.
- Scan using the actual production scanner.
- Follow GS1 or partner rules when standards compliance is required.
FAQ
Is Code 128 free to generate?
You can generate Code 128 barcode images with free tools such as AiNowly’s Barcode Generator. Standards, identifiers, or commercial workflows may have separate requirements.
Can Code 128 contain letters?
Yes. Code 128 can represent alphanumeric data and symbols, which is one reason it is popular for internal inventory and logistics labels.
Is Code 128 the same as GS1-128?
No. GS1-128 uses Code 128 symbology within the GS1 system and includes FNC1 plus structured GS1 Application Identifier data.
Can I create an EAN barcode with a random number?
You can technically draw a barcode pattern from numbers, but a retail product identifier should follow the numbering and ownership rules required by your retail or GS1 workflow.
Why does my barcode scan on screen but not on paper?
Printing introduces resolution, contrast, size, surface, and distortion issues. Test the physical label and increase size or print quality if necessary.
Bottom line
If you need a Code 128 barcode generator online free, AiNowly gives you a quick browser workflow for creating and downloading barcode PNGs. Use Code 128 for flexible internal alphanumeric labels, but do not confuse a generic Code 128 image with GS1-128 or a formally assigned retail identifier.
Generate your code with the AiNowly Barcode Generator, print a real test label, and verify it with the scanner that will actually be used.