How it works
Eight symbologies
Four are 2D matrix codes (Micro QR, Data Matrix, Aztec, PDF417) that hold text, serial numbers or ticket data. Four are linear (Code 128, Code 39, EAN-13, UPC-A), read by ordinary shop scanners.
bwip-js, a JavaScript port of the Barcode Writer in Pure PostScript, encodes the content; the tool then draws the modules itself so the PNG, the SVG and the preview are the same picture.
The input only accepts what the chosen type can carry: digits for EAN-13 and UPC-A, capitals, digits and - . $ / + % space for Code 39, and printable ASCII for the rest. Switching to a type that cannot hold what you typed clears the field.
Check digits
EAN-13 and UPC-A end in a check digit computed from the others. Type 12 digits (EAN-13) or 11 (UPC-A) and the digit is added for you; type the full number and a wrong last digit is flagged with the right one.
The digits are weighted alternately 1 and 3 for EAN-13 (3 and 1 for UPC-A), summed, and the check digit is what brings the sum up to the next multiple of ten.
check = (10 − (Σ digit × weight) mod 10) mod 10
Size and quiet zone
Module is the width in pixels of the thinnest bar or the side of one square cell; the image is the code's modules times that. Linear codes are 60 modules tall, and EAN/UPC guard bars run 5 modules further into the digit line.
Padding is the empty margin in modules. Scanners need a quiet zone: about 10 modules beside Code 128 and Code 39, 7 to 11 for EAN-13 and 9 for UPC-A, 1 to 2 for Data Matrix and PDF417; Aztec needs none. Each type starts with a safe padding.





