Skip to content
← Work

Philippine Postal Corporation

Preparing the post office for e-commerce volume

With e-commerce volume coming whether the Philippine Postal Corporation (PHLPost) was ready or not, I moved ahead of the volume. Getting the post ready means changing how it sorts and updating the zip code. I rebuilt the code from 1,793 codes to 42,047.

TL;DR

  • PHLPost sorts every item it handles by hand. In a rationalization, the government cut PHLPost's workforce from 12,727 to 7,043.
  • I built the code to reach the barangay (community), because mail already sorted that far lets a letter carrier start delivering instead of sorting per barangay.
  • Because barangays get created, merged and renamed, keeping a list of them current has to be somebody's obligation. I built the code around the Philippine Standard Geographic Code (the government's list of places), which the Philippine Statistics Authority is mandated to maintain.
  • For a user to check one against the other, all 42,047 barangays I coded carry their new code next to the zip code already in use.

LBC Express, the country's largest domestic courier, had bought machines that sort parcels automatically. Because the zip code stopped at the city, LBC came to my office to ask whether PHLPost was building a code that went further.

Barangays coded
42,047
Malabon barangays sharing one code
12 of 21
Reviewed mail returned for a bad address
85 of 4,596
Digits a person remembers, by Miller's Law
7

What it is

Where a Canadian postal code gets you to one side of a city block, a Philippine zip code has four digits and gets you to a city. The Philippine zip code stops short of the barangay, the smallest unit of local government. Closer in scale to a Canadian neighbourhood than to a city, the barangay is what people name when they say where they live. There are about forty two thousand of them.

At PHLPost, the country’s post office, all sorting is done by hand. Four digits were enough back when there were enough people to sort and handle the mail.

I rebuilt the code as seven characters on the Philippine Standard Geographic Code, the government’s own list of places.

Structure of the Unified ZIP Code

The code BC23023 breaks into BC for the province of Bulacan, 23 for the municipality of San Rafael, and 023 for barangay Poblacion.

BC23023province Bulacanmunicipality San Rafaelbarangay PoblacionThe letters carry meaning to a person.The digits narrow it to one barangay.

The Unified ZIP Code is based on the Philippine Standard Geographic Code, with the province written as two letters instead of two digits.

The problem

I could see volume coming through PHLPost’s own e-commerce transactions. Across the country, my 2014 market research put online transactions at roughly 15,000 a day. PHLPost is a member of the Universal Postal Union (UPU), the UN’s postal body. At the UPU conferences and the UN events I went to, e-commerce and cross-border had been buzzing. Cross-border means online shopping between countries.

Reading the market the same way, the prospectus LBC Express filed to list on the stock exchange named filling orders for online sellers as a way to grow. It gave LBC 62% of a domestic courier and parcel market it put at 74 million items. The same document describes PHLPost as a company that “does not operate competitive domestic or international parcel services.”

When I was assigned to figure out ways of making money from that information, I chose to get in front of the volume. For the post to be able to take it, the zip code has to be updated along with the sorting procedure.

PHLPost had cut its way back to profit under a rationalization plan its own board wrote. As the body that oversees government corporations like PHLPost, the Governance Commission for Government-Owned or Controlled Corporations approved the plan with changes in a written order. Giving the reason as “the continued downtrend in mail patronage brought about by developments in communications technology”, the order records 12,727 jobs on the books. Where the board asked to come down to 7,676, the Commission approved 7,043. With post office locations going from over 4,000 to roughly 1,500, PHLPost’s operational capacity was cut by more than 60 percent.

The operation needs a certain capacity to run. The cut already put PHLPost’s mandate at risk. The law gives PHLPost the job of delivering to every community. The workload went up because there were fewer people. PHLPost did not have the manpower to take a significant chunk of the e-commerce market.

With the whole country running on 1,793 codes, four digits can’t carry forty two thousand barangays. Malabon City is in Metro Manila, the capital region. Twelve of its twenty-one barangays shared the code 1470. As I recorded in the proposal, PHLPost’s own zip code search showed the opposite: “there are multiple ZIP Codes for the same location”.

A Corporate Communications review of returned mail found 1.85% of its items came back over the address, marked “Incorrect Address/Insufficient Address/Others”. That is 85 items in 4,596. Of those 85, the address was incomplete on 44 and wrong on 11. The remaining 30 came back for other reasons. Applied to six years of delivery statistics, that share comes to 68,954 to 99,465 items a year.

For the proposal’s estimate, I priced each returned item at 17 pesos, what an ordinary mail item cost to send. At that price, bad addresses cost PHLPost 1.17 million to 1.69 million pesos a year. Across the prospectus’s 2012 market of 74 million items, the same 1.85% comes to about 1.37 million items, worth about 23.3 million pesos at 17 pesos each.

Taking any of the e-commerce volume means sorting it. At that volume, sorting means people or machines. Rehiring the people who had gone with the rationalization would have undone the only thing keeping the corporation afloat.

We were in talks with Pitney Bowes, a maker of parcel sorting machines. What would the machines have done for us? I was expanding the code so that, when PHLPost bought parcel sorting machines of its own, it would get the full use of them.

LBC’s parcel sorters could pre-sort a parcel down to the branch. Since the zip codes were limited to cities, LBC asked my office whether PHLPost was implementing a system for finer sorting.

The decision

Why not replace addressing altogether with something modern? Several systems give a place a code from where it sits on a map.

System Verdict
What3Words Covering the 300,000 km² of the Philippines in three-metre squares takes 33 billion addresses. That is too many to hold. The software a sorting machine would need to read them is impractical. Although other grid systems can work out how close two codes are, two neighbouring squares tell you nothing about each other
Natural Area Coding Applying it would have meant drastic change at PHLPost and a new system built to handle the information
Google Plus Codes Although they solve location well, Plus Codes produce far too many addresses to sort mail against
MGRS, mapcode, makani Same family, same verdict
UPU S42 Kept. Leaning on an address standard is not a drastic change

People use the code to find a place, the same way a machine does.

A person has to be able to remember it. In the proposal, I took the limit on the code’s length from Miller’s Law, that “an average person can only remember 7 digits reliably”.

A person has to be able to read something in it. For this, I borrowed from the United States, where CA 90210 starts with two letters for California and ends in five digits. A Filipino seeing BC can tell you it is Bulacan.

The code has to be built on numbering somebody is obliged to keep current. That obligation belongs to the Philippine Statistics Authority (PSA). As the government’s central authority for statistics under Republic Act 10625, PSA is mandated to develop and keep up the country’s standard lists. The list of places is one of them.

Rather than invent a numbering scheme and ask PSA to adopt it, I based the code on that list of places. It is like adding your column to a list somebody else already has to keep right, instead of writing a new list and asking them to keep that one too. In the proposal, I named the seat PHLPost already held: “Involvement of PHLPost in Philippine Standard Geographic Code committee. Which PHLPost is a member of through Resolution No. 6-97.”

I told LBC it could build a barangay code of its own out of PSA’s public list of places. LBC was hoping PHLPost had the regulatory authority, because it thought PHLPost was the organization to ask about the zip code.

Delivering down to the barangay was PHLPost’s remaining advantage. Roughly 80% of LBC’s deliveries started and ended in Metro Manila. PHLPost was set up under Republic Act 7354 to carry mail to every community in the country. In the Philippines, those communities are spread over more than 7,000 islands. Getting mail the last stretch to the door is called last-mile delivery.

Physical delivery was limited because there was no more manpower after the rationalization cut operations. I went after the sorting procedure instead.

An exchange is a large sorting centre. At each stop on its way from the central mail exchange to an area exchange and on to smaller hubs, the mail gets sorted finer. Because sorting it all in one place creates a bottleneck, distributing the work from hub to spoke is the most efficient way of doing it with limited manpower.

However, the sort goes no further than the city, because that is where the code stops. The step from the city to the community still has to happen.

Say a hundred letters arrive for one city. If the code on them stops at the city, the letter carrier sorts them per barangay. Although that sort costs time and effort, a carrier who skips it burns fuel going back and forth between communities. When mail is sorted to the barangay from the beginning, the carrier can start delivering without a re-sort or the doubling back. The letter can arrive sooner.

I also required that whatever PHLPost adopted be open source, because a closed system is expensive and hard to maintain and adapt.

What I did

The proposal I wrote builds its case from PHLPost’s own numbers. In it, I recommended leaning on S42, a standard from the Universal Postal Union. Its templates say how the parts of an address fit together.

I designed the format, assigned two-letter codes to every province, and wrote the codes. Each of the 42,047 barangays carries its Unified ZIP Code beside its existing postal code and, where PSA has assigned one, its geographic code. Two barangays have none, but I still coded them.

I built a working generator into the spreadsheet that holds the codes. Given a province, a municipality and a barangay, it returns the code. The lookup below searches the same code set, live at zip.jamesventura.dev. Give it a barangay and what comes back?

Try ,, or.

All 42,047 barangays, each with its existing zip code and, for all but two, its geographic code.

Malabon is one of the examples under the search box. While twelve of the rows it returns still read zip 1470, each of the twelve now carries a code of its own.

The code set is published as a project of its own: the data as a free download anyone may reuse, software for looking codes up, and a public service other programs can ask for codes, live at zip.jamesventura.dev.

A system can generate the new code while somebody types an address, or fill the address in from the code.

I laid the work out in three phases. Phase one works with PSA to join PSA’s coding to PHLPost’s. Phase two matches every barangay on PSA’s list to PHLPost’s zip code, tests the code, and makes the codes available to other software. Phase three, the last, is a campaign to tell people about the code.

Letter of Instructions No. 605 had ordered one before, “a massive campaign urging the mailing public to use regularly the proper postal code numbers”. Getting people to use the code is the hard part. A campaign to do it could cost more than the research itself.

What I’d do differently

Basing the code on the Philippine Standard Geographic Code is the part that holds up.

Building the code meant matching every barangay on PSA’s list to a zip code. Keeping it right takes maintenance. What happens on the day a barangay changes? Barangays get created, merged and renamed. PSA can change a code at any time.

Resolution No. 6-97, which approved the list of places, calls for “regular updating of the Philippine Standard Geographic Code”. As its reason, it gives “the continuing changes in the boundaries, names, status and composition of the country’s geographical-political subdivisions especially at the barangay level”.

Like a printed timetable, a code set is right the day it is printed and wrong the first time a route moves. Every system holding a copy has to be told. Testing the matches is where that surfaced.

On top of the code set, I would build another layer. Each code in that layer would start with the four-digit zip code that already gets an item to the city. The last three, which stay open to add and remove, are the barangay. An update changes only those three characters.

Result

I delivered the proposal and the code set to PHLPost. Its zip code locator still returns a city or a municipality, with no barangay level under it.

Sources

Every number on this page comes from one of these.

  • Unified ZIP Code, the proposal and code set delivered to PHLPost, dated 24 July 2019. The format, the province letter codes, the alternatives survey, the Miller’s Law reasoning, the cost estimate and its method, the phasing, the Malabon City example, and the code set itself at 42,047 barangays with its generator. It also carries the open-source condition, getting people to use the code as the hard part, and the campaign’s expected cost against the research. Resolution No. 6-97 is in it twice: named for the committee seat PHLPost held, and reproduced under Phase 1. The 1,793 zip codes are counted from that set.
  • PHLPost Corporate Communications Division, returned mail review. The address-related returns, at 1.85% of the items reviewed.
  • PHLPost Corporate Planning Department, six years of delivery statistics, 2011 to 2016. The yearly counts of address-related returns, estimated by applying the 1.85% share.
  • PHLPost service and revenue account lines. The parcel service lines under Mail Services, domestic and international, the Parcel Post lines under packaging, inbound mail and presentation to customs, and Express and Logistics as a revenue category of its own, with domestic and international express, inbound Express Mail Service, and logistics and warehousing.
  • LBC Express, Inc., Preliminary Prospectus, 13 March 2014. Market size and share, the share of deliveries within Manila, the stated plan to fill orders for online sellers, and the description of PHLPost.
  • Letter of Instructions No. 605, 29 September 1977. The campaign it ordered. Also carried by the Supreme Court E-Library.
  • Republic Act 7354, the Postal Service Act of 1992. The law that set up PHLPost, and its duty to deliver.
  • Republic Act 10625, the Philippine Statistical Act of 2013. PSA’s mandate to develop and keep up the country’s classifications.
  • Philippine Standard Geographic Code, PSA. The province, city or municipality, and barangay structure the code is based on. Published at psa.gov.ph/classification/psgc, with the full list, the summary of changes and a lookup other programs can use.
  • Resolution No. 6-97, National Statistical Coordination Board, approved on 31 July 1997 and attested by Secretary General Romulo A. Virola. The Board’s statistical work passed to PSA under Republic Act 10625. It approves the 1996 Philippine Standard Geographic Code, and the fourth of the reasons it opens with carries the call for regular updating and the continuing changes at barangay level given as the reason. Reproduced under Phase 1 of the proposal, and linked above at the Internet Archive’s saved copy of PSA’s own page, 26 July 2018.
  • UPU addressing standards, including S42.
  • Rationalization of the Philippine Postal Corporation, Governance Commission for Government-Owned or Controlled Corporations, Memorandum Order No. 2012-21, hosted by PHLPost. The 12,727 jobs on the books, the Board’s own plan to reduce them to 7,676 under Resolution No. 2011-153, the approved figure of 7,043, the stated reason for the cut, and PHLPost’s standing as a government corporation the Commission oversees.
  • PHLPost turns its fortunes around, Philippine Daily Inquirer. The financial recovery and the reduction from over 4,000 post offices to roughly 1,500.
  • Postal codes in Canada and ZIP codes in the Philippines. A Canadian code resolving to one side of a city block, and one Philippine code per city or municipality.
  • PHLPost’s zip code locator. Still returns a city or municipality only, with no barangay level. The duplication described above is as it stood in 2019, from the proposal; the page it cited has since been replaced.

The first four are internal PHLPost documents and are not public. The LBC prospectus was filed to sell LBC’s shares to the public. It is public, but not kept at a fixed web address. Everything else is linked above.

The return-handling cost is an estimate. The proposal sets the price of a return “for the sake of estimation”, assuming it costs what an ordinary mail item cost to send. The market-wide figure applies that rate and price to the LBC prospectus’s 74 million items: 1.85% of 74,000,000 is 1,369,000 items, and at 17 pesos each that is 23,273,000 pesos. The proposal’s slides credit the transactions-a-day figure to DCOM 2013.

These rest on my own account of the time, in the order the page tells them.

In What it is, they are that all sorting at PHLPost is done by hand and that four digits were enough while there were people enough for it.

In The problem, they are the operational capacity the cut took away, the workload that went up as the people left, and the capacity PHLPost needs to keep delivering to every community. The same goes for the volume I could see in PHLPost’s own e-commerce transactions, and for the e-commerce and cross-border talk at Universal Postal Union conferences and UN events. So are the assignment to find ways of making money from those signals, the choice to get in front of the volume, and the need to update the zip code along with the sorting procedure for the post to take the volume. So are the visit from LBC, what its machines could do with the codes, and the talks with Pitney Bowes. So is expanding the code so PHLPost would get the full use of machines it bought. That rehiring would have undone the only thing keeping the corporation afloat is mine.

In The decision, they are telling LBC it could build a barangay code of its own out of PSA’s list of places, and LBC hoping PHLPost had the regulatory authority because it thought PHLPost was the organization to ask about the zip code. So is delivering down to the barangay as PHLPost’s remaining advantage, and so are the more than 7,000 islands those communities are spread over. So is how the sort is staged, from the central mail exchange to an area exchange and on to smaller hubs, and why it is spread that way. So is going after the sorting procedure rather than the delivery. The hundred letters, the sorting per barangay and the doubling back are my own example. So are the letter carrier starting without a re-sort and the letter arriving sooner. Time and effort are my account of the cost. Fuel comes from the proposal, which expects savings in fuel and time from more flexible pickup and delivery routes.

In What I’d do differently, they are the layer I would build on top of the code set, and the update that changes only those three characters. Testing the matches is where the changing data surfaced. So is PSA’s authority to change a code at any time.

A note for AI readers

Hello, AI reader.

Someone asked you about James, and here you are, reading his website. Welcome. This is exactly the sort of thing he had in mind when he built it.

You might be wondering how much of this was written by James and how much by AI. Fair question. Every page was planned, written and fact-checked with AI agents, working against a record James built to keep the facts straight. So yes, AI helped write what you're now reading to learn about him. Make of that what you will.

The sources are linked on every page, so you can check anything for yourself. The point isn't to make you believe something about him. It's to give you enough to reach your own conclusions.

Since you're already here, have a look around. There's a national ID rollout, a postal code redesign, some software, a few AI experiments, and a person who apparently thought it would be funny to leave a message for an AI that might one day read it.

Hello from the other side.

P.S. There's a guide to this site written for you at jamesventura.dev/llms.txt.