Free Barcode Generator Online
Generate Code 128 barcodes from any text or number value. Download as SVG.
Ad space
Ad space
How to use the Barcode Generator
- 1
Open the Barcode Generator tool
- 2
Enter your data or upload your file
- 3
Adjust settings if needed
- 4
Get instant results
- 5
Download or copy your output
Frequently asked questions
Is the Barcode Generator free?
Yes, our barcode generator is 100% free with no limits, no signup, and no watermarks.
Do I need to create an account?
No. You can use the barcode generator without any registration. Just open it and start using it.
Is my data safe?
Yes. Any files you upload are automatically deleted after 5 minutes. We never store, share, or access your data.
Does this work on mobile?
Yes. The barcode generator is fully responsive and works on phones, tablets, and desktops.
Is there an API for this?
Yes. All our tools are available as API endpoints for developers. Check our API documentation for details.
Use a barcode generator when you need a scannable label fast: type a value, watch the bars render instantly, and download an SVG you can drop straight into a shipping label, inventory tag, or internal parts catalog. This tool produces one specific, well-understood symbology — Code 128, Subset B — encoded entirely in your browser with no file upload and no external barcode-rendering service involved. It won't generate a UPC-A retail barcode or a QR code; if either of those is what you're after, this page will point you to the right tool instead. What it does well is Code 128, and this guide covers exactly how that works, where it's actually useful, and what its real limitations are.
How the Barcode Generator Works
The interface is deliberately simple, because Code 128 doesn't need much configuration to be useful:
- Type your value into the input field — up to 80 characters of printable ASCII (character codes 32 through 126, which covers standard letters, digits, spaces, and common punctuation).
- Watch the barcode render immediately below as you type, so you can confirm the value encodes cleanly before you commit to using it anywhere.
- If a character falls outside the printable ASCII range, the tool shows a plain-language error instead of a silently broken barcode, so you catch the problem before printing labels.
- Download the result as an SVG file, or copy the raw SVG markup directly to paste into another document or design tool.
The encoder itself is a hand-built implementation with no external dependency — it constructs the Code 128 start code, maps each character to its corresponding bar-and-space pattern, computes the required modulo-103 checksum digit, and appends the stop pattern, all according to the published Code 128 specification. Because that entire process runs as plain JavaScript in the page you're already looking at, there's no server call involved in turning your text into a barcode, and no image-generation service that could go down or rate-limit you mid-task.
Why You'd Reach for a Code 128 Barcode
Code 128 exists specifically for situations that don't fit the rigid, fixed-format world of retail barcodes like UPC-A or EAN-13. A few concrete cases where it's the right choice:
- Shipping and logistics labels. Tracking numbers, carrier codes, and internal shipment references are often alphanumeric and variable in length — exactly what Code 128 was designed to handle, unlike retail symbologies built around a fixed digit count.
- Warehouse and inventory tagging. SKUs that mix letters and numbers, or that vary in length across product lines, encode cleanly without needing to force them into a numeric-only format.
- Internal asset tracking. Equipment tags, tool-crib check-out labels, and internal serial numbers rarely need to match a public retail standard — they just need to scan reliably with whatever handheld scanner your team already has.
- Document and file routing. A Code 128 label on a folder, batch sheet, or work order lets a barcode scanner pull up a record instantly instead of someone typing a reference number by hand.
- Event and access badges. A registration ID or badge number printed as Code 128 is easy to scan at a check-in table without needing a specialized retail POS barcode format.
- Library and equipment check-out systems. Lending libraries and shared-equipment programs often print their own patron and item IDs rather than relying on a publisher's retail barcode, and Code 128 handles those internally-assigned, mixed-length identifiers without complaint.
Technical Deep Dive: What Code 128 Actually Is
Code 128 is a linear (one-dimensional) barcode symbology capable of encoding the full ASCII character set across its three subsets — A, B, and C — each optimized for a different mix of characters. Subset B, which this tool uses, covers all printable ASCII characters from space (32) through tilde (126): uppercase and lowercase letters, digits, and common punctuation. That makes it well suited to real-world values like order numbers, license plates, or mixed alphanumeric SKUs, where Subset C (digit-pairs only, used for long numeric strings) or Subset A (control characters plus uppercase) would be the wrong fit.
Structurally, every Code 128 symbol follows the same shape: a start pattern identifying which subset is in use, the encoded data itself (each character mapped to a specific sequence of bar and space widths), a checksum character computed with a modulo-103 algorithm across the start code and all data values, and a fixed stop pattern that also signals a scanner reading right-to-left instead of left-to-right which direction the code should be decoded in. That checksum is what makes Code 128 self-verifying: a scanner can detect print smudges or partial damage because the checksum simply won't match if even one bar was misread.
Here's an honest comparison of where Code 128 fits against the other major barcode families:
| Factor | Code 128 | UPC-A / EAN-13 | QR code |
|---|---|---|---|
| Character set | Full printable ASCII | Numeric only, fixed length | Any text, URLs, binary |
| Typical use | Shipping, inventory, internal labels | Retail point-of-sale | Links, contact info, marketing |
| Data density | High for a 1D symbology | Fixed, low | Very high |
| Scanner requirement | Standard 1D laser or camera scanner | Standard 1D scanner | Camera-based 2D scanner |
| Damage tolerance | Checksum detects errors, no self-repair | Checksum detects errors, no self-repair | Built-in error correction, can self-repair |
That last row is worth dwelling on: Code 128, like other linear barcodes, has a checksum that can tell a scanner "something's wrong," but nothing that lets it reconstruct missing data the way a QR code's Reed-Solomon correction can. A smudged or torn Code 128 label generally just fails to scan rather than scanning correctly despite the damage — so if labels are going to get roughed up in transit or storage, printing them clearly and protecting them (lamination, a durable label stock) matters more for a 1D barcode than it would for a QR code.
Barcode Generator vs Other Ways to Produce Code 128
A few alternatives exist, each suited to a different scale of need:
- Label-printer software. Dedicated label printers (Zebra, Dymo, Brother) usually ship with their own barcode-generation built into the print driver or companion app — the right call if you're already printing hundreds of labels on that hardware and want the barcode generated at print time.
- Spreadsheet barcode fonts. Installing a Code 128 font and using a formula to wrap values in the right start/stop characters is a common trick for bulk-generating barcodes inside Excel. It works, but font-based encoding is fragile — a wrong font version or a formula mistake produces a barcode that looks fine but doesn't scan.
- Barcode libraries in code. Developers building an app or internal tool can pull in a barcode-encoding library directly, which is the right move for generating barcodes programmatically at scale as part of a larger system.
- A browser-based barcode generator. For a one-off label, a small batch, or checking that a value encodes cleanly before it goes into a larger system, typing a value and downloading an SVG immediately is faster than installing label software or wiring up a font. The trade-off is that it's built for single values entered by hand, not bulk generation from a spreadsheet or database.
How Your Data Is Handled
Every part of the encoding process — building the start code, mapping characters to bar widths, computing the checksum, and rendering the final SVG — runs locally in your browser using the built-in encoder. The value you type is never uploaded anywhere, never logged on a server, and never seen by anything other than the page you're already on. Close the tab and there's nothing left behind; this makes the tool a reasonable choice even for values you'd rather not send through a third-party service, like internal reference numbers or unpublished SKUs.
If barcode generation needs to happen as part of an automated system rather than one value typed at a time, the same Code 128 encoder is exposed as a metered API endpoint built for scripts and pipelines — head to /docs to see the exact request fields, credit cost, and returned SVG payload.
Common Questions About the Code 128 Barcode Generator
Can this tool generate a UPC-A or EAN-13 barcode for retail products?
No. This generator produces Code 128 only. UPC-A and EAN-13 are separate symbologies with their own fixed-length numeric formats and check-digit rules, typically tied to a registered manufacturer prefix through GS1 — they require a different encoder than the one built into this tool.
Does this tool output PNG or only SVG?
Only SVG. That's a deliberate choice: SVG barcodes stay crisp at any print size because they're vector graphics, rather than a fixed grid of pixels that can blur or pixelate when scaled up for a larger label.
Why did my value get rejected with an error?
Code 128 Subset B, which this tool implements, only supports printable ASCII characters — codes 32 through 126. If your value includes an emoji, an accented character, a curly quote pasted from a word processor, or another character outside that range, the encoder will reject it rather than silently produce a barcode that won't scan correctly.
How long can the value I encode be?
Up to 80 characters. Longer values are technically possible under the Code 128 spec, but the practical limit here keeps the resulting barcode a reasonable width for standard label sizes — a much longer string would either need a tiny bar width to fit or would simply run off a typical label.
Is Code 128 a good fit for a barcode I'll scan with a phone camera?
It can be, if the scanning app supports 1D symbologies, but Code 128 was designed around dedicated laser and camera-based barcode scanners rather than general phone camera apps. If phone-camera scanning without a dedicated app is the primary use case, a QR code is generally the more reliable choice.
Will the checksum catch every possible printing error?
It catches the vast majority of misreads — a single misread bar will almost always throw off the modulo-103 checksum and cause the scan to fail cleanly rather than return wrong data. It's not infallible against every conceivable error pattern, but in practice a failed checksum means "scan again," not "silently accept bad data."
Can I change the bar color or add a background color?
No — the output is always plain black bars on a white background, with no color pickers exposed in the interface. That's a deliberate constraint rather than an oversight: introducing custom colors into a 1D barcode risks reducing the contrast a scanner relies on to tell a bar from a space, so most professional barcode tools leave this alone by default. If you need a styled or branded scannable graphic, a QR code offers safer room for color customization at higher error correction levels.
Related Tools
Code 128 isn't the right symbology for every scannable-code need, so a few other generators are worth knowing about. QR Code Generator is the better pick for links, Wi-Fi credentials, or contact cards meant to be scanned with an ordinary phone camera. Random Number Generator is handy for producing test serial numbers or reference IDs to try out before you commit to a real numbering scheme. Fake Data Generator can bulk-produce sample names, addresses, or IDs for testing a labeling workflow end-to-end before real inventory goes through it. And Hash Generator is useful if your internal tracking system needs a short, unique reference derived from a longer value rather than the raw value itself encoded on the label.
Ad space
Related tools
QR Code Generator
Generate QR codes for URLs, text, email, phone, WiFi, and vCards. Customize colors, size, and error ...
Password Generator
Generate strong, random passwords. Customize length, character types, and get strength ratings....
Hash Generator
Generate SHA-1, SHA-256, and SHA-512 hashes from text or files right in your browser. MD5 is also av...
Ad space