Barcode Generator
Turn text into a Code128 barcode, downloadable as a crisp SVG.
What is Barcode Generator
A barcode generator converts a string into a Code128 one-dimensional barcode. Code128-B supports ASCII characters 32–126 (letters, digits, symbols), and the result downloads as a sharp SVG. Everything runs locally in your browser.
🔒 Everything runs in your browser. Nothing is uploaded.
What this tool actually does with your file
- Where it runs
- In your browser, on this page
- Upload
- None — the file never leaves your device
- Offline
- Works with the network disconnected
Code 128-B covers printable ASCII and nothing else
The B subset encodes the 95 printable ASCII characters, space through tilde. Anything outside that range — accented letters, CJK, emoji, a newline — is filtered out before encoding, because the symbology has no code points for them. If the output looks shorter than the input, that filtering is the reason.
Code 128 can switch subsets mid-symbol to pack digits more densely (subset C encodes two digits per symbol character), which is why long numeric strings make shorter barcodes in some generators. This implementation stays in B for predictability.
The checksum is mandatory, and the quiet zone too
Every Code 128 symbol ends with a modulo-103 check character computed from the start code and the weighted values of all data characters. A reader that returns a value at all has already verified it — which is why a misread is rare and a failure to read is common.
Scanners also need a quiet zone of at least ten modules on each side. A barcode printed flush against a label edge, or with text touching the bars, will fail on hardware that worked in testing.
Choosing a symbology for a real requirement
Code 128 is the general-purpose choice for internal labels, shipping and asset tags. Retail products need EAN-13 or UPC-A, which are numeric-only and fixed-length with their own check digit — a Code 128 label will simply not scan at a retail POS.
For anything printed small, check the X-dimension: bars and spaces must each be at least about 0.25 mm for reliable scanning, so a long payload forces a physically wider label. Shortening the encoded value is usually cheaper than buying a better scanner.
How to use it
- 1.Enter the text to encode
- 2.Click Run
- 3.Download the SVG
How Barcode Generator works under the hood
Generators here produce values locally with the browser's cryptographic random source. The output is generated on your device, not issued by a server, so there is no record of what was generated.
- 1
Seed from the platform CSPRNG
Values come from crypto.getRandomValues, not Math.random, so they are suitable for passwords and tokens.
- 2
Map to the requested alphabet
Random bytes are mapped to the chosen character set while rejecting values that would bias the distribution.
- 3
Render on the page
The result is shown and can be copied; it is not stored or sent.
Processing pipeline
Strength comes from length and source
A 20-character password from a 90-symbol alphabet has far more entropy than a 12-character one, and both are only as good as the random source. This site uses the platform CSPRNG, so the remaining risk is reuse, not generation.
Nothing is logged
Generated values are never transmitted, so there is no server log, no history and no recovery. Save what you need before closing the tab.
Verify it yourself
Generation is local. Reload the page and the values are gone.
- 1.Open DevTools on this page and switch to the Network tab
- 2.Keep the filter on Fetch/XHR and run the tool
- 3.Confirm no request carries your file — you should see only page assets and fonts
Frequently asked questions
What is Code128?
A widely used one-dimensional barcode symbology that encodes letters, digits, and symbols as bars of varying widths. Common in logistics and inventory.
Which characters are supported?
Code128-B supports ASCII 32–126 (letters, digits, symbols, space). Non-ASCII characters such as Japanese are stripped automatically.
Why SVG?
SVG stays sharp at any size, making it ideal for printing and labels. Download and use it directly.
More in Generators
On this page
- What is Barcode Generator
- What this tool actually does with your file
- How it actually behaves
- How to use it
- How it works inside
- Frequently asked questions
Excel formula reference
29 functions with syntax, arguments and a table you can retype.
Browse the list →