A system I'm developing is using ISO 3166-2 codes / names to serve as a dropdown for users to pick their state / province / country / etc. However, as I recently learned, some countries, like Great Britain, have gone a bit overboard with their subdivisions, making it a bit hard for some users to pick the correct one for themselves. For example, instead of having "Greater London", you have to specify the specific borough inside of London, etc.
This made me have an idea that if I took the postal code someone put in their address field I could pre-populate the proper area and not have to ask the user for it, saving some confusion.
I was wondering - is there some list or service that correlates a postal code to an ISO 3166-2 code, ideally on a global scale? I know it's possible to find such data sets for the US or UK individually, but I haven't found anything on a global scale...