parcel sorterwarehouse automation3PL operationscarrier barcodeslogistics automation

How to measure and improve parcel sorter accuracy

By Harshil Lakhani ·

In short

To measure parcel sorter accuracy, receive a copy of every sorter scan, run the same barcode-to-carrier rules the sorter uses, and compare the expected lane with the lane the parcel went to. Report the share on the right lane every hour, with lists of wrong-lane parcels and unknown barcode formats, so new carrier formats and mapping errors are fixed the same day.

You measure parcel sorter accuracy by running the same barcode-to-carrier rules as the sorter on a copy of every scan, then comparing the lane each parcel should have taken with the lane it actually took. Accuracy is correct lanes divided by all checkable scans. Report it every hour with the list of mistakes and unknown barcodes, and you can fix most problems in the same shift.

I built this monitor for a Dutch 3PL fulfilment company after they installed a parcel sorter with one lane per carrier. The sorter's own software still decides the lanes. My service only watches it.

Why does sorter accuracy matter for a 3PL?

A parcel on the wrong lane ends up in the wrong carrier's cage. At best someone spots it at loading. At worst it travels with the wrong carrier, gets rejected, comes back days later, and the end customer files a complaint with the seller.

Without monitoring, nobody knows the error rate. A sorter's own screens usually report throughput, not correctness. And the error lane fills up for reasons nobody writes down.

How does a parcel sorter decide the lane?

The sorter scans the label and matches the barcode against a format rule per carrier. The rules I use follow the configuration the warehouse gave the sorter supplier. Examples of the formats:

  • DHL eCommerce NL: JVGL followed by 20 digits
  • PostNL: 3S, four letters, then nine digits
  • Colis Privé: R followed by 11 digits
  • DHL Germany: 003404 followed by 14 digits
  • DHL International: two letters, nine digits, ending in DE
  • Evri UK: H, three digits, two letters, ten digits
  • bpost: 24 digits

A carrier partner that handles several European countries adds its own formats for Italy, Sweden and Denmark, Czechia, Austria, and Spain and Portugal. One of its German formats is identical to DHL Germany's, so by design those parcels share the DHL Germany lane.

Two rules make this work:

  1. Normalise first. Trim spaces and uppercase the code before matching.
  2. Specific before broad. The bpost rule is "any 24 digits", which would swallow other formats if it ran first. It always runs last.

Anything that matches no rule belongs on the error or manual lane.

How do you check expected versus actual lane?

The sorter sends a copy of each scan to a small web service over HTTP as JSON. Each scan carries the barcode or barcodes, a device id, often an output line number, a send time and a reason code.

For each scan the service:

  1. Normalises the barcode and finds the matching rule.
  2. Looks up which physical line that carrier's lane is on, from a lane-to-line setting.
  3. Reads the actual line from the line number, or from the device id when no line is sent.
  4. Marks the scan as correct, wrong line, or not checked.

"Not checked" means the check was impossible: the lane has no line in the mapping yet, or the scan carried no line. It is reported separately. If you count it as wrong, accuracy looks worse than it is. If you count it as right, you hide a configuration gap.

Labels with more than one barcode

Some labels carry two barcodes, for example a carrier code and a reference. The service checks all of them and uses the one a rule recognises, because that is the one the sorter routes on.

What causes sorter errors?

From the hourly reports, mistakes fall into a few groups:

  • A new carrier format. A carrier changes its label or a new service goes live. The parcel lands on the error lane until a rule is added.
  • Rule order. A broad rule catches codes meant for a specific one.
  • Lane mapping drift. Someone moves a carrier to another chute on the sorter and the configuration is not updated.
  • Shared formats. Two carriers use the same pattern, so a rule alone cannot separate them.
  • No read. The barcode is damaged, covered by tape or folded. The report shows these as an empty barcode.
  • Device mapping. A scanner id does not follow the line number and needs an explicit mapping.

How do you handle duplicate scans and retries?

Sorters resend scans after network errors, and batch messages can repeat. Each scan gets an id: a hash of its sorted barcodes, send time, device and line. The service remembers ids from the current and previous report period and counts each one once.

A scan with no barcode or no time cannot be told apart from another, so it gets no id and is always counted. That is the honest choice: dropping it would hide no-reads.

Scans are filed by when they arrived, not by their own timestamp. A scan sent late in a batch still lands in a report that has not gone out yet, and the report shows its real send time.

What should an hourly sorter report contain?

Each report covers one period, by default one hour, and opens with one line: "97.8% on the right line", for example. Below it:

  • total scans
  • correct
  • wrong line
  • unknown barcode format (error or manual lane)
  • not checked, with the reason
  • a list of wrong-lane parcels: time, barcode, carrier rule, expected line, actual line, sorter reason
  • a list of unknown formats, with a note that a new carrier format may need a rule

Lists are capped at 200 parcels per period, while the counts stay complete. The email subject carries the headline: "Sorter check 14:00: 97.8% right, 12 wrong line". A period with no scans sends nothing.

How do you build the ingest service?

The sorter supplier sees only this service, so it exposes only the scan endpoints and a health check.

Decisions that kept it simple to run:

  • Access key with rotation. A long key, plus a previous key that keeps working while a new one is rolled out.
  • IP allowlist. Only the warehouse's public IP may post.
  • Separate rate limits. Requests with a wrong key are limited per address and never slow down the real sorter.
  • Tolerant parsing. Senders name fields differently (billCode, BillCode, chute or line) and some send JSON with a byte-order mark or encoded twice. The service accepts all of them.
  • Size limits. Real barcodes are under 40 characters. Longer values are cut. Oversized bodies get a 413.
  • Counts, not rows. Scans are counted in memory and one summary per period is written to Firestore, every five minutes and at period end. Writes stay at a few per hour however many parcels pass.
  • Save on shutdown. Counts are flushed before every restart. A crash loses at most five minutes of counts.
  • The report is its own lock. The report document is written when the email goes out, so each period is reported exactly once.

What should you measure?

  • accuracy per hour and per day
  • wrong-line count per carrier lane
  • unknown formats per day and the most common new patterns
  • no-reads per hour, a sign of print or label quality problems
  • not-checked scans, which should be zero once mapping is complete
  • error-lane parcels as a share of total volume

Should you build or buy sorter monitoring?

Ask your sorter vendor first. Some offer lane reports, but they usually report what the sorter decided, not whether the decision was right. An independent check needs your own carrier rules and your own lane mapping, which is why I built a separate service. It is small: a few hundred lines plus tests.

Sorter accuracy checklist

  • Write down the barcode rule for every carrier service
  • Order rules from specific to broad
  • Keep a lane-to-line mapping outside the sorter
  • Receive a copy of every scan
  • Separate "not checked" from "wrong"
  • Deduplicate retries with a scan id
  • Report hourly with lists, not only a percentage
  • Add a rule the same day an unknown format appears

This monitor is part of my logistics automation services for warehouses. Read the parcel sorter lane accuracy monitoring case study and see how it fits the 3PL fulfilment operations platform. Sorting only helps if parcels are ready in time, so also read how to hit every carrier cutoff.

Running a sorter and not sure how accurate it is? Contact me and we can set up a check in a few days.

Frequently asked questions

Divide parcels sent to the correct lane by all parcels that could be checked, meaning correct plus wrong lane. Leave out scans you could not check, such as a lane with no mapping yet, and report them as their own number. Mixing them in makes accuracy look worse or better than it is.

It matches the scanned barcode against a format rule per carrier. For example, DHL eCommerce NL codes start with JVGL followed by 20 digits, and PostNL codes start with 3S. Specific rules are checked first and broad ones last. A barcode that matches no rule goes to the error or manual lane.

The usual causes are a carrier format missing from the rules, rules checked in the wrong order, a label carrying two barcodes, a lane mapping changed on the sorter but not in the configuration, and damaged barcodes. An hourly list of wrong-lane parcels with expected and actual lane shows which one it is.

Give each scan an id built from its barcodes, send time, device and line, and count each id once. Sorters resend scans after network errors, so the same parcel can arrive twice. Keep the ids for the current and previous report period, which covers late retries without unbounded memory.

Hourly works well for a busy sorter. It is quick enough to catch a new carrier format or a wrong lane mapping during the same shift, and it keeps reports short. A period with no scans should send nothing, so an idle sorter at night does not fill the inbox.

Need an automation like this?

Tell me what your team does by hand and which tools are involved.

Discuss your project