Skip to content

Start ​

Node 20.16 or later.

sh
npx barcode-grader label.pdf
label.pdf: 3 codes on 1 page

UPC-A  036000291452
  Check digit  right (2)
  Size         70%, X 0.231 mm (GS1: 80–200% for retail tills)
  Bar height   8.0 mm (needs 16.0 mm at this size)
  …
  Verdict      Will likely fail
  x Below GS1's 80–200% for retail tills. Make it at least 80%.

Each code gets one of three verdicts.

verdictmeaningexit code
Looks rightnothing found0
Check thisworth a look; may be fine for your case1 by default (--fail-on fail ignores it)
Will likely failbreaks a GS1 rule, or a scanner is unlikely to read it1

No code in a file, or a file that can't be read, exits 2.

Pictures need a print size ​

A PDF or SVG knows how big it prints. A PNG or JPEG only does if it carries a resolution. Without one, everything except size is still checked; give the size to measure it:

sh
npx barcode-grader artwork.png --width 50    # printed width in mm
npx barcode-grader artwork.png --dpi 300

Next ​

MIT licensed. It predicts from the artwork; it is not a verifier.