Generate a Code 128 barcode for an asset tag, a carton number or a shelf label
The tool loads here. It needs JavaScript, because the work happens on your device.
Your files and your privacy
The value you type is encoded on your own device and the bars are drawn there; nothing is
uploaded and nothing is stored between visits. This product generates barcodes only: it
contains no scanner, asks for no camera permission, and has no way to read a code you
point at it.
What this tool does
Turn a short ASCII value into a Code 128 barcode and export it as a PNG or an SVG, with
the value optionally printed under the bars. The encoder picks the code set, packs digit
runs two to a symbol and adds the required check character.
It converts a short ASCII value — an asset tag, a carton number, an internal reference —
into a Code 128 bar pattern and draws it as a PNG or an SVG, optionally with the value
printed underneath in a monospace line. Any character above ASCII 127 is refused with the
offending characters named, rather than dropped or substituted: a barcode that has
silently lost a character is worse than one that was never made. This product generates
only, and asks for no camera permission.
How to use it
Type the value into the Code 128 panel. The preview redraws as you type, and an
unsupported character produces a message naming it.
Decide whether to print the value under the bars. Leave it on unless the label has no
room, because it lets a person read a code a scanner cannot.
Set the bar and background colours if you need something other than black on white, and
watch the contrast warning.
Export SVG for a label template or PNG for a document, then scan the printed result with
the scanner that will be used in practice.
Example use cases
Labelling equipment with an internal asset number so it can be checked in and out.
Numbering cartons or shelf locations in a small warehouse without buying label software.
Printing a single replacement label when the original has been torn or worn away.
Supported input and output
Accepts
ASCII characters 0 to 127: digits, letters, punctuation and spaces
One value per barcode; there is no batch, list or spreadsheet mode
Produces
PNG, four pixels per narrow bar and 160 pixels of bar height
SVG, vector, three pixels per narrow bar with the optional text line
What this tool will not do
Code 128 covers ASCII only. An accented letter, a curly quotation mark or an em dash is
rejected with the character named, because the symbology cannot carry it.
This is plain Code 128, not GS1-128: no FNC1 character is emitted, so the application
identifiers used in supply-chain labelling are not produced.
It is the only symbology here — no EAN, UPC, ITF, PDF417 or DataMatrix. Formats tied to
registered product numbering are unlikely to be added, because producing one wrongly is
worse than not producing it.
The quiet zone is fixed at ten narrow bars each side; the quiet-zone control in the
settings panel applies to the QR code, not the barcode.
The transparent-background option applies to the SVG export. The PNG is always drawn on
a solid background, falling back to white when transparency is ticked.
Common mistakes
Typing a check digit by hand. The encoder calculates the modulo-103 check character and
places it in the bars, so a hand-added one becomes part of the data and the scanner
reads back an extra character.
Trusting the line printed under the bars as the full value. Non-printable characters
such as a tab are encoded into the bars but stripped from that caption, so the scanned
result can be longer than the text you see.
Letting a leading or trailing space into the field. Spaces are perfectly encodable, so ‘
12345’ scans back with the space attached and never matches ‘12345’ in a database.
Butting label text or a border against the bars. The ten-bar quiet zone is part of the
symbol, and crowding it causes intermittent failures that look like a scanner fault.
Technical notes
Encoding uses the automatic Code 128 encoder from jsbarcode, which selects the starting
code set and inserts the switch characters itself: a run of digits is encoded in set C at
two digits per symbol, which is why twelve digits give a 101-module pattern while eleven
letters and punctuation give 145. Each symbol is eleven modules wide, with a start
pattern, the modulo-103 check character and a thirteen-module stop pattern around the
data. Characters above ASCII 127 are rejected before the encoder is reached, and its own
validity check is honoured as a second gate.
Frequently asked questions
Do I need to add a check digit myself?
No. The modulo-103 check character is calculated during encoding and included in the
bars. Adding your own would make it part of the encoded data instead.
Can it produce EAN or UPC codes for retail products?
No, only Code 128. Retail numbering formats depend on registered company prefixes and
their own check-digit rules, and a plausible-looking but wrong retail barcode causes
real problems downstream.
Can it scan or decode a barcode?
No. This product generates codes and nothing else. There is no scanner, and it never
requests access to a camera.