International postal address format

I am currently working on a personal project which involves the user entering their address to be searched. I wanted to ensure this application is designed properly, so it can easily be scaled to work with international postal address. However, after some research it is still far from clear what format I should follow.

Many answers online make suggestions based on US format, which is not very helpful for other countries with slightly different formats. I have included the address fields for my project below, I am sure for some countries this might not be 100% correct, but this is the best one I can come up with so far. Just FYI, I'm mainly focusing on UK addresses here.

  • Address Line 1 (Room 15)
  • Address Line 2 (Flat A)
  • Address Line 3 (15 Street)
  • City (London)
  • Postcode (XX00 0XX)
  • County (Middlesex)
  • Country (United Kingdom)
Buy Me A Coffee