The international standard for identifying postal items

2025-06-1215:0212427www.akpain.net

The Universal Postal Union's S10 standard, in all its glory

The Universal Postal Union's S10 standard, in all its glory

Have you ever received a parcel from overseas? I did recently, from Switzerland!

an image of an empty shipping packet

Looking at the envelope, I realised the format of the tracking number (UT038926726CH) was in a very similar (if not identical) format to ones I'd used frequently here in the UK.

I'd been receiving emails from Royal Mail about the parcel, so I just presumed that there was some data-sharing agreement in place with Swiss Post and Royal Mail had just given the parcel their own internal reference number.

a screenshot of a royal mail delivery notification

But seeing the reference number printed on the envelope from the get-go made me want to see what Swiss Post had to say about it...

a screenshot of a swiss post consignment tracking page

The same tracking number works across multiple carriers, and it's the same format as all the UK ones! What gives??

Enter: the United Nations Universal Postal Union

The Universal Postal Union (UPU) is an agency of the UN that coordinates postal policies to facilitate post flowing across the world. As part of this, it publishes the S10 standard for the identification of postal items in a 13-character format - ie. what we've been seeing on our parcels!

If you're interested in learning more about the UPU's interesting 150-year history, you might want to check out this article written by fellow webring inhabitant Imaan!

Each country's national postal service is assigned as having exclusive reign over S10 codes for that country, and they go about issuing S10 codes from their country.

Tracking Number Format

As it turns out, the structure of our tracking number has a strict design, and our tracking number contains four distinct things:

Character number Format Description
1 and 2 2 letters Service indicator
3 to 10 8 digits Serial number
11 1 digit A check digit
12 and 13 2 letters ISO 3166–1 country code representing the origin of the item

The Service Indicator

The first two characters represent the service that's been used to post the item. There's a fairly extensive list in the standard, with specific options for tracked post, letter post, parcel post... the list goes on. The most interesting part of the service indicators are threefold:

First, there are specific carve-outs in the specification for an organisation called EMS - they get all E prefixes, so EA, EB, EC, and so on and so forth. EMS is an express international mail service that's run by the UPU itself, but that delegates operations to the national postal services that control their country's S10 codes. This is why you'll not see any way to buy shipping using EMS directly on their website - you buy express international shipping at your local post office and they route it accordingly. It's also worth noting that this only applies to express shipping - not regular-rate traffic.

Second, countries are allowed to override some of the service indicator assignment rules set out in the S10 standard. This can happen when either a parcel is being sent domestically or when a carrier has an agreement with other countries' carriers to reassign some service indicators for other purposes, hence the inclusion of the origin country code to aid interpretation of tracking numbers where this is the case.

Lastly, some service indicators are explicitly disallowed from being used. These are JA–JZ, KA–KZ, SA–SZ, TA–TZ and WA–WZ since these carry the risk of causing a tracking number to be confused with codes from a different UN data encoding standard.

All in, the possible service indicator space looks like this:

Table source

The Serial Number

This is just a serial number. It's exactly 8 digits long and is generated by the originating carrier as they see fit, provided they don't resue the same number within 12 months. In theory, this means a lost parcel can only be lost for 12 months before it vanishes from the world forever, but in reality, the S10 recommends not reusing a number within a minimum period of 24 months. Even then, you have 10 million parcels per service indicator per country available to be issued, so it's probably not going to be necessary for a carrier to reuse a number for a much longer period of time anyway.

The Check Digit

The check digit corrects any errors in the serial number preceding it, using the following algorithm:

  • Multiply each digit in the sequence with the corresponding number from this sequence: 8 6 4 2 3 5 9 7
  • Sum all these values
  • Divide the sum by 11
  • Substrac the remainder from 11
  • If the result is in the range 1-9, use that as the checksum
  • If the result is 10, use 0 as the checksum
  • If the result is 11, use 5 as the checksum

This is not a particularly strong checksum, but it's good enough to guard against a couple of accidental digit-swaps here and there. You can play with an interactive demo of it here.

Barcode Format

The S10 standard requires tracking numbers to be printed on an item as a barcode, either being in Code 128 or Code 39 format.

Additional barcodes on the label are discouraged, particularly for international items, and carriers that must include other barcodes are required to use a different format and not obscure the S10 code. This is why you'll see Royal Mail, for example, using data matrices on their labels.

The square code on the left side is the data matrix, the barcode on the right is the S10 code

Other Fun Things in the Standard

  1. A plaintext representation of an S10 code must be printed within 1-5mm of the barcode
  2. Such plaintext should be in the format AB 123 456 789 GB
  3. Sans-serif fonts are required, with specific requirements as to the sizing of each letter
  4. National carriers are allowed to delegate issuing responsibility to a third party provided they can ensure no number is reissued within the year
  5. The country code at the end of the tracking number isn't actually a reliable indicator of the country of origin but the nationality of the carrier of origin (eg. in the case of an overseas territory, a national carrier could still use the mainland code)

Read the original article

Comments

  • By Ecco 2025-06-143:339 reply

    With a limit of 10 million different serial numbers, I wonder how China does it. I can't come up with a decent estimate, and maybe I'm way off. But with the growth of sellers like Shein or Temu, I wouldn't be surprised if they shipped that many parcels in like a single day ? Or at least in a timeframe short enough that they would have over 10 million shipped but yet-to-be-delivered parcels, effectively running out of tracking numbers.

    • By Scoundreller 2025-06-144:411 reply

      What helps is that they don’t ship direct from China by mail much. They often send in bulk to the destination country and then mail locally, and local post systems can have their own domestic format.

      Or they have their own private courier do the last mile delivery too so it never touches any postal operator.

      • By bravesoul2 2025-06-145:301 reply

        Do they? In Australia usually get them direct from HK or China because it is cheaper to do that even than post it within Australia!

        • By Scoundreller 2025-06-150:07

          In Southern Ontario Canada, yes, even in the suburbs, most stuff is dropped off by some rando courier for a few years now.

          Somehow cheaper than paying bulk international airmail rates.

    • By zinekeller 2025-06-1417:28

      > With a limit of 10 million different serial numbers, I wonder how China does it.

      The author has issued a correction, it's 100 million numbers per service indicator. But even then, it's probably not enough.

      The boring answer is that your shipping options are either get untracked postal service (which the S10 standard does not apply) or use a private courier (which also does not use the S10 standard).

      If you insist, you got two options for UPU-based postal tracking: normal e-commerce parcel aka H-codes, practically 2,300,000,000 trackable packages per year [1]. EMS is the other route, and there are another 2,300,000,000 trackable packages per year [2]. However, in my experience tracked postal delivery is only used in certain countries where it is more advantageous than private delivery (like until very recently in the US, for complicated reasons [3]), while other destinations has a more-than-willing private delivery partner (that is not the Big Three [4]) or even set up the delivery systems themselves.

      1: 23 service indicators: HA-HW, HX-HZ are reserved for multilateral/bilateral use only

      2: another 23 service indicators: EA-EW, EX-EZ are reserved for multilateral/bilateral use only

      3: https://www.thewirechina.com/2020/11/22/delivering-chinas-ma... https://www.ft.com/content/a1233f3e-d21a-11e8-a9f2-7574db66b...

      4: DHL, FedEx, and UPS

    • By Sharlin 2025-06-146:151 reply

      Yeah. Apparently last year they shipped over two million small parcels to Finland (pop. 5.6M) alone, which is completely bollocks.

      • By thebruce87m 2025-06-1521:351 reply

        > completely bollocks

        Do you mean “bonkers”? Because “bollocks” in this case would mean “made up”.

    • By wombatpm 2025-06-145:31

      Service type and serial need to be unique. Countries control what that 2letter field means. There is no rule against multiple codes indicating the same service. So AA through AZ would give you 260,000,000 unique combinations that you shouldn’t reuse for 1 year. Rinse, later and repeat if you need more.

    • By somat 2025-06-1420:521 reply

      Is the serial number even in base 10? the other parts of the number allow letters, the article does not say, but it could easily be base 36. which is close to 3 trillion serials.

      Plus a bonus rant: this is one of those things that looks like a number and as such you are tempted to use a number to store it, but its not, it's a string, you will never do math on it so it is not a number. see also: phone numbers, social security numbers, serial numbers.

      and sheepish bonus update: there is a checksum, so math is done on it. wonder if the checksum makes more or less sense in base 36? probably less, the checksum almost looks base12-ish, the mod(11), but there are special cases for two digit values so it is probably base 10.

      • By woooooo 2025-06-1421:57

        Eh, your comment here was checksummed several times as well crossing the network. Doesn't make it "a number".

    • By xattt 2025-06-143:50

      You could hate it by an internal metric, like date received.

    • By mongol 2025-06-146:051 reply

      And I wonder what was the constraint to not make it longer when they developed the standard. Making it a few digits more seem it wouldn't cost much.

      • By omcnoe 2025-06-146:231 reply

        The cost will be in updating every legacy postal system that currently has fixed column lengths/input field length limits.

        • By topsecret 2025-06-1411:191 reply

          Yes, now, but the person you're replying to was asking about at inception.

          • By rjh29 2025-06-153:43

            Why was IPv4 so pitifully small? I guess most people thought 100 million parcels a year was a ridiculously generous limit that we'd never reach.

    • By benced 2025-06-146:29

      Even the US must easily run into this constraint.

    • By crtified 2025-06-1421:56

      The short answer is probably : in-house consolidation.

  • By ThePowerOfFuet 2025-06-1418:56

    Does anyone know what's going on with the DataMatrix code next to the address on some mail, such as periodicals such as magazines, which contains the full name and address of the recipient in what looks to be a standardized format with field separators?

  • By bloak 2025-06-146:47

    Does that complex algorithm for the check digit have any advantage over the much simpler algorithm used for EANs or 13-digit ISBNs?

HackerNews