A barcode generator is only as useful as the barcode it produces β and a barcode that a real retail scanner, phone camera, or inventory app can't actually read is worse than no barcode at all. This tool builds a genuine, standards-compliant Code 128 symbol entirely in your browser: it computes the correct start code, encodes every character using the official symbol-value table, calculates the mandatory modulo-103 checksum, and paints the exact bar-and-space widths onto a canvas element. Nothing is faked, simplified, or approximated β the output is the same symbology used on shipping labels, retail shelf tags, ID badges, and warehouse bins around the world.
We built this as a free utility from Arb Digital because so many "barcode generators" online simply draw random-looking stripes that look convincing but fail the moment a real scanner tries to read them. This one doesn't cut that corner. Enter any text, adjust the bar width and height, download a clean PNG, and drop it straight into a label template, a product page, or an internal tracking sheet.
What This Barcode Generator Does
Type in any combination of letters, numbers, spaces, or common punctuation, and the tool immediately encodes it as Code 128 β one of the most widely supported 1D (linear) barcode symbologies in commercial and industrial use. As you type or adjust the settings, the canvas redraws instantly: no page reload, no server round-trip, no upload of your data anywhere. The generator automatically picks the most efficient encoding subset for your input (more on Code Set B versus Code Set C below), computes the check digit that scanners use to confirm a clean read, and renders bars at the exact module widths the specification requires so a phone camera or laser scanner can decode it correctly.
Once you're happy with the result, the Download PNG button exports the canvas as a standalone image file you can paste into Word, Canva, a label printer app, or an e-commerce product listing.
How to Use the Barcode Generator
- Type your content. Enter the text or number you want encoded β a SKU, a serial number, an asset tag, a coupon code, or a tracking ID.
- Adjust bar width and height. Wider modules (2β3px) make the barcode easier to scan from a distance or with older hardware; increase the height if the label will be scanned at an angle.
- Choose whether to show the readable text. Most retail and shipping labels display the human-readable value beneath the bars so a person can verify it visually.
- Click Generate Barcode. The canvas redraws instantly with the finished symbol, and the stats panel shows the code set, symbol count, checksum, and final pixel width.
- Download the PNG and place it on your label, packaging, spreadsheet, or web page.
How Code 128 Encoding Actually Works
Code 128 is a high-density linear barcode that can represent the full ASCII character set using three interchangeable code sets β A, B, and C β each mapping input values to one of 107 predefined bar/space patterns. This tool implements Code Set B (letters, digits, and punctuation, one character per symbol) and Code Set C (pairs of digits compressed into a single symbol, used automatically for even-length numeric strings). Every symbol in Code 128 is exactly 11 modules wide, built from three bars and three spaces of varying width, except the stop pattern, which is 13 modules wide to signal the true end of the message.
Encoding proceeds in four steps: first, a start symbol tells the scanner which code set to expect. Second, each input character (or digit pair, in Code Set C) is converted into a symbol value using the official code table. Third, a checksum is calculated: the start value plus the sum of each data symbol's value multiplied by its position, taken modulo 103. This checksum symbol is appended right before the stop pattern, and it's what lets a scanner detect a misread or a smudged label instead of silently returning the wrong data. Finally, a stop symbol and a trailing bar close out the message, with a quiet (blank) zone left on each side so the scanner's optics can distinguish the barcode from its background. You can verify the official symbology rules yourself at GS1's General Specifications, the organization that governs commercial barcode standards worldwide.
Code Set B vs. Code Set C β Why It Matters
Code Set B encodes one character per symbol and covers the full range of upper- and lower-case letters, digits, and standard punctuation β it's the general-purpose choice and what this tool uses for anything that isn't a clean even-length number. Code Set C, by contrast, only encodes digit pairs (00 through 99) but packs two digits into the space a single character would normally take. That means a 12-digit numeric code encoded in Code Set C produces a barcode roughly half the physical width of the same code in Code Set B β extremely useful when label space is tight, as it often is on small retail shelf tags or pharmacy vials. This tool automatically switches to Code Set C whenever your input is 100% digits with an even length, and falls back to Code Set B for anything else, including odd-length numbers (since Code Set C requires digits in pairs). The stats panel always tells you exactly which code set was used so there's no guesswork.
Code 128 vs. QR Codes vs. UPC β An Honest Comparison
These three symbologies solve different problems, and picking the wrong one is a common mistake. UPC-A (and its cousin EAN-13) is a fixed-length, digits-only barcode used almost exclusively for retail point-of-sale β every UPC has to be registered through GS1 and tied to a specific product, which makes it a poor fit for anything that isn't a retail item sold at checkout. Code 128, what this tool generates, is far more flexible: it handles letters and punctuation as well as numbers, has no fixed length restriction (within reason), and is the standard choice for shipping labels, inventory and asset tags, internal serial numbers, and logistics β it's what you'll find on most FedEx, UPS, and USPS labels alongside a routing barcode. QR codes are a 2D (matrix) symbology, not a linear barcode at all β they store far more data (URLs, contact cards, Wi-Fi credentials) in a square grid readable by any smartphone camera, but they need more surface area and a 2D-capable scanner or camera app, whereas Code 128 can be read by cheap, ubiquitous laser barcode scanners still used at millions of checkout counters and warehouse scan guns.
In short: reach for UPC/EAN when you're selling a retail product through standard retail channels, reach for Code 128 when you need a flexible, scanner-friendly linear barcode for internal tracking, shipping, or any alphanumeric identifier, and reach for a QR code when you want a smartphone camera to open a link or capture more data than a linear barcode can hold.
Arb Digital builds fast, conversion-focused websites, product catalogs, and e-commerce systems β including inventory and label workflows like this one. If your business needs custom tooling beyond a free calculator, we're happy to talk.
Talk to Arb Digital All Free ToolsPractical Uses for a Barcode Generator
Small businesses and internal teams reach for Code 128 far more often than most people realize, usually without thinking of it as "barcode technology" at all. A boutique shipping out its own orders might print a Code 128 label containing an internal order number so the warehouse team can scan a package and instantly pull up the customer record instead of typing it in by hand. A dental office or clinic might tag equipment or supply bins with a Code 128 asset number to track maintenance schedules and inventory counts without buying an expensive asset-management platform. Event organizers frequently encode ticket or badge IDs as Code 128 so a simple, inexpensive scanner at the door can check attendees in within a second, far faster and more reliable than manually searching a spreadsheet.
Warehouses and fulfillment centers lean on Code 128 constantly for bin locations, pallet IDs, and pick-list references, because it tolerates a wider range of characters than UPC and prints cleanly even at small sizes on a standard label printer. Freelancers and consultants sometimes use it for simple client or invoice tracking systems, encoding an invoice number onto a printed statement so a barcode scanner (or even a phone scanning app) can pull up the matching record instantly rather than requiring someone to retype a long reference number. In every one of these cases, the appeal is the same: Code 128 is free to generate, doesn't require registering anything with a standards body, and works with the huge installed base of inexpensive barcode scanners already sitting in warehouses, retail counters, and shipping departments worldwide.
Common Mistakes to Avoid
- Making the bars too thin for the print method. A cheap thermal or inkjet printer can blur 1px modules into unreadable smears β use at least a 2px module width for anything printed small.
- Removing the quiet zone. The blank margin on each side of the barcode isn't decorative β scanners use it to detect where the symbol starts and stops. Don't crop it tightly when placing the PNG on a label.
- Assuming any 1D barcode reader can read a QR code, or vice versa. Linear scanners (laser or CCD wand style) generally can't decode 2D symbologies like QR β check your scanning hardware before committing to a format.
- Forgetting the checksum matters. If you're manually recreating a barcode value elsewhere (e.g., in a database), remember the visible text and the encoded checksum are different things β don't strip or alter either independently.
- Using characters outside standard ASCII. Code 128 Code Set B supports standard printable ASCII; accented letters, emoji, or special Unicode symbols aren't part of the specification and will not encode correctly on real hardware.
Related Free Tools From Arb Digital
Pair this generator with our Text-to-Speech tool for reading label content aloud, or check out our Business Days Calculator and Week Number Calculator for scheduling and logistics planning. If you're building internal tools for your business, explore our full free online tools hub for more developer and everyday utilities.
Frequently Asked Questions
Yes. It implements the real Code 128 symbol table, start/stop patterns, and modulo-103 checksum exactly as defined by the specification, so a standard barcode scanner or scanning app should read it correctly when printed at a reasonable size.
Standard printable ASCII characters β upper and lower case letters, digits 0β9, spaces, and common punctuation such as hyphens and periods.
The tool automatically switches to Code Set C for even-length, all-digit input, which packs two digits into every symbol instead of one, roughly halving the width.
Not directly β retail point-of-sale systems require a registered UPC or EAN barcode tied to your product through GS1. Code 128 is best for internal tracking, shipping labels, and asset tags rather than retail checkout scanning.
No. All encoding and rendering happens locally in your browser using JavaScript and the canvas element β nothing is sent anywhere.
The barcode exports as a PNG file, which works well for printing, pasting into documents, or uploading to most label-design and e-commerce platforms.
This tool runs entirely in your browser using built-in JavaScript. Nothing you enter is uploaded, stored, or sent to any server.