DHL Packstation PostCard Barcode

updated 2 min read #note #reverse engineering

This note shows how the barcode on a DHL Packstation customer card is calculated from the PostNummer, with a small generator for your own number.

Note (2026): Packstation pickup now runs through the Post & DHL app. According to DHL, the customer card’s barcode is now only used to activate the Packstation feature in the app, so this generator is mostly of historical interest.

For a long time, picking up a parcel at a DHL Packstation meant typing in the PostNummer embossed on the golden customer card and then entering an mTAN. A new yellow customer card with a barcode on the back was meant to simplify this: customers scan the card and then enter their mTAN. Unfortunately, owners of the old PostCard didn’t get the new card automatically. I didn’t want to apply for a new card at the time, so I generated the barcode myself. It doesn’t contain the PostNummer itself, but a longer number calculated from it.

The barcode number is calculated as follows:

  1. Multiply the PostNummer by 631.
  2. Calculate the Luhn checksum for the number obtained in step 1.
  3. Assemble the number: “3000” + result from step 1 + Luhn checksum.
  4. Encode this number as an ITF (Interleaved 2 of 5) barcode.
function generateBarcode(postNummer) {
  const step1Result = postNummer * 631;
  const luhnChecksum = calculateLuhnChecksum(step1Result);
  const barcodeNumber = "3000" + step1Result + luhnChecksum;
  const itfBarcode = generateITFBarcode(barcodeNumber);
  return itfBarcode;
}

The form below does the calculation in your browser; the number is not sent anywhere. It shows the digits only, so use a barcode generator of your choice to turn them into an ITF barcode.




Barcode number:

Sources#

cd ~/writing