← Home

📊 Barcode Generator

Generate Code128 barcodes from any text. Download or print instantly.

What is this tool?

The Barcode Generator is a free online tool that creates Code128 barcodes from any text input. Barcodes are used everywhere in retail, logistics, inventory management, libraries, and manufacturing. Code128 is one of the most versatile barcode symbologies, supporting the full ASCII character set and offering excellent density. Enter any text up to 80 characters, and the tool renders a high-quality Code128 barcode in your browser. The generated barcode includes human-readable text below the bars and can be downloaded as a PNG image for use in labels, product packaging, or inventory systems. The tool automatically calculates the mandatory checksum digit for data integrity. All processing is done client-side using HTML Canvas, so no data is uploaded to any server.

How it works

The tool implements the Code128B encoding standard in JavaScript. It starts by mapping each input character to its Code128B value using the standard encoding table. A start code (Code B) is prepended, and a checksum character is calculated by summing the weighted values of all characters (including the start code) and taking the result modulo 103. A stop code is appended at the end. Each encoded character is converted to a series of bars and spaces using the Code128 encoding pattern. The tool renders the barcode onto an HTML Canvas element, drawing each bar at the correct width. The human-readable text is rendered below the barcode. The resulting canvas can be exported as an image using the toDataURL() method. The barcode height and module width are optimized for readability and standard label sizes.
Ad

How to use

  1. Type or paste the text you want to encode into the input field.
  2. Choose the barcode height (small, medium, or large).
  3. Click Generate to render the barcode instantly.
  4. Check that the barcode is clear and the text below matches your input.
  5. Right-click the barcode image and select Save to download as PNG.

Frequently Asked Questions

Frequently Asked Questions

What is Code128?
Code128 is a high-density barcode symbology that encodes the full ASCII character set. It is widely used in logistics and inventory management.

Can I use these barcodes commercially?
Yes. Code128 is a public-domain standard with no licensing restrictions. The generated barcodes can be used on any product or label.

How many characters can I encode?
Code128B supports up to 80 characters for practical barcode readability. Longer text may produce very wide barcodes.

Does the barcode include a checksum?
Yes. The tool automatically calculates and appends the mandatory Code128 checksum digit for data integrity.

Tips & Advice

When printing barcodes, ensure the minimum width is at least 1.5 inches (about 38 mm) for reliable scanning. White space (quiet zone) on both sides of the barcode is critical: leave at least 1/4 inch of blank space on each side. Test your barcode with multiple scanners before mass production. For product UPCs, use dedicated UPC barcode generators, as Code128 is different from retail UPC standards. Higher contrast between bars and background improves scan reliability use black bars on a white background.

Related Generators

Ad