DESIGN & WEB

Barcode Generator

Code 128, EAN-13, EAN-8 and UPC-A barcodes as clean SVG or PNG, encoded in the browser to the standard, with check digit, symbol table and print size stated.

A barcode file you can place in artwork, with the check digit computed, every symbol listed, and the physical width at your X dimension.

Example: "Wikipedia" in Code 128 is 12 symbols with check value 88 — 134 modules, 50.82 mm wide at X = 0.33 mm; EAN 400399415548 gets check digit 6.

v0.1.0 · last reviewed 19 September 2026
Loading the workspace…
BUILT TO BE UNDERSTOOD

Encoded to the standard,
checked against another encoder.

Which symbology to pick, how the bars are built, what the check digit is, and what this page does not judge.

Code 128

Code 128 (ISO/IEC 15417) encodes any ASCII text. Every symbol is 11 modules wide — three bars and three spaces — and the symbol values come from three code sets: A (upper case and control characters), B (upper and lower case) and C (pairs of digits, twice as dense). This page chooses code sets greedily: runs of four or more digits switch to C, control characters need A, everything else uses B. The choice is always valid and matches common encoders for ordinary text, but it is not guaranteed to be the shortest possible symbol in every case. A check value (the weighted sum of all symbol values modulo 103) is appended before the stop pattern; readers reject a symbol whose check fails. With the GS1-128 option a FNC1 follows the start code; the page does not check the application-identifier structure of the data.

EAN-13, EAN-8, UPC-A

Retail numbers (ISO/IEC 15420, GS1 General Specifications) encode each digit in seven modules using one of three patterns: L (odd parity), G (even parity) and R (the L pattern inverted). EAN-13 carries its first digit implicitly in the L/G parity sequence of the next six; UPC-A is EAN-13 with a leading 0, so its left half is all L. The last digit is the GS1 check digit: multiply digits alternately by 3 and 1 from the right, sum, and take what brings the total to a multiple of 10. Enter the number without its check digit to have it computed, or with it to have it verified — a wrong one is refused, not silently replaced. The parity pattern and the final number are shown so you can compare them with a supplier's artwork.

Size, quiet zones, and the files

A barcode's physical size follows from the width of one module, the X dimension. GS1 specifies 0.330 mm as the nominal (100 %) X for EAN/UPC at point of sale, with 80 % to 200 % magnification allowed; Code 128 has no nominal, so the X you enter is yours. Light quiet zones are part of the symbol: 10X each side for Code 128, 11X left and 7X right for EAN-13 (the page draws the larger on both sides), 7X for EAN-8, 9X for UPC-A. The SVG is drawn at two units per module with crisp edges, so it scales without blur; the PNG is rasterised in your browser at the pixel width you set. Human-readable digits and guard bars follow the usual EAN layout.

How it was checked

The encoder is written on this site, not imported. Its Code 128 pattern table is tested for the standard's structural invariants (11 modules, even number of dark modules, all 107 patterns distinct), and the bit patterns for sample texts and numbers — including "Wikipedia" (check value 88), 4003994155486 and 96385074 — are compared bit for bit with an independent encoder. That comparison caught a reversed G pattern during development; it is the reason it stays in the test suite.

What the tool does not settle

Whether a number is yours to use: GS1 company prefixes are licensed, and a retailer will reject an EAN that is not registered to the product. Whether the printed result scans: print gain, contrast and substrate decide that, and a verifier grades it (ISO/IEC 15416) — this page does not. Other symbologies (Code 39, ITF-14, GS1 DataBar, Data Matrix) are not offered. Nothing you enter leaves the browser; the same four anonymous usage counts as the rest of the site apply.

SOURCES

Last reviewed 19 September 2026. How results are checked: How we verify.