Barcode Generator
runs in your browserMake EAN-13, EAN-8, UPC-A, Code 128, Code 39 and ITF barcodes as crisp SVG or PNG — check digits computed, printed size shown, encoded on your device.
EAN-13: 12 or 13 digits — retail products worldwide; the 13th is a check digit, computed if left off.
about this tool
Six symbologies, encoded here
The generator encodes the codes that cover almost every label: EAN-13 and EAN-8 (retail products worldwide), UPC-A (retail in North America), Code 128 (any ASCII text, the densest choice for shipping and logistics), Code 39 (digits, capitals and a few symbols, for older systems) and Interleaved 2 of 5, both plain and as ITF-14 with its bearer bars for shipping cartons. Each is encoded from its published tables into a string of modules and drawn as SVG; nothing is looked up and nothing leaves the page.
The retail codes and ITF-14 carry a GS1 check digit. Type the number without it and it is computed; type all the digits and it is verified, with the right one named if it is wrong. Code 128 chooses its subsets automatically, the way the GS1 specification recommends: subset C for runs of digits (two per symbol), B for text, A only when a control character forces it, with the switches placed so digit pairs line up. Its own check symbol is included and, as the symbology requires, never printed.
Drawn to be scanned
The SVG has one rectangle per bar, crispEdges rendering, a quiet zone of
ten modules each side by default, and — for the retail codes — the guard bars
extended and the digits laid out under the bars as they appear on a pack,
with the leading digit outside the symbol. Module width, bar height, quiet
zone, colours and the text line are adjustable. The tool reports the printed
width at 100 % magnification (0.33 mm modules), the size retail codes are
specified at; scanners are happiest between 80 % and 200 % of it.
Downloads are SVG, which label software prefers because the geometry stays exact, and PNG rendered at three times the screen size with smoothing off.
Checked against an independent encoder
Every encoder here is compared, in the project's tests, module for module with jsbarcode's output — for the GS1 example numbers, a sweep of EAN-13 first digits (each changes the parity pattern), Code 39 and ITF strings, and Code 128 inputs chosen to exercise every subset switch. The tests are what caught two mistakes on the way: the EAN even-parity set is the right-hand codes reversed, not the left-hand ones, and the ITF stop bar is three modules wide.
Limits
No GS1-128 application identifiers, no EAN-2/EAN-5 add-ons, no UPC-E, no 2D codes (the QR generator covers QR). A retail number must be one issued by GS1 for the product; the tool encodes what you give it and cannot know whether the number is yours. Nothing is stored.
To read a code rather than make one, use the QR & barcode scanner. For a URL, Wi-Fi network or contact card, the QR code generator is the better fit.
questions
- Which barcode should I use?
- EAN-13 for a product sold at retail anywhere but North America, UPC-A for North America — both need a number issued by GS1; you cannot invent one. Code 128 for anything else: shipping labels, tickets, asset tags, any ASCII text, in the least space. Code 39 only when an older system demands it. ITF-14 is the carton-level code printed on shipping cases, with the bearer bars that stop misreads.
- Do I type the check digit?
- No. For EAN-13, EAN-8, UPC-A and ITF-14, type the number without its last digit and the tool computes it; if you include it, the tool verifies it and tells you the right one if it is wrong. Code 128 has an internal check symbol that is never shown; Code 39 has none.
- How large should the printed barcode be?
- EAN and UPC codes are specified at 100 % magnification with 0.33 mm modules — 37.3 mm wide including quiet zones — and may be printed between 80 % and 200 % of that. Below 80 % most checkout scanners struggle. The tool reports the width at 100 % for whatever you have encoded, and the SVG scales without loss.
- Why is the download an SVG rather than a PNG?
- A barcode is bars of exact widths, and any resampling of a bitmap can shift an edge by a pixel and break the read. SVG keeps the geometry exact at any print size and is what label and packaging software wants. The PNG export is rendered at three times the on-screen size with smoothing off, for tools that cannot take vectors.
- Is the encoding correct?
- The encoders are written from the published symbology tables and, in this project’s tests, compared module for module against an independent open-source implementation for every symbology, including Code 128’s automatic subset switching and the GS1 check-digit examples.