title: How does WhatsApp know the country code of my contacts?
body: <p>I'm in the US, where a phone number looks like this:</p>
  
  <blockquote>
    <p>without country code: 123-456-7890</p>
    
    <p>with country code: +1 123-456-7890</p>
  </blockquote>
  
  <p>Now, according to Wikipedia, a phone number in Italy has this format:</p>
  
  <blockquote>
    <p>347 xxxxxxx (from within Italy)</p>
  </blockquote>
  
  <p>So that could look like a US number: 347-123-4567</p>
  
  <p>When I open all my contacts on WhatsApp, it automatically adds the country code, so if I have a US phone 123-456-7890, it adds a +1. But how does it know it's a US number? It could have been anything.</p>
  
  <p>I guessed that it uses my current locale or timezone to determine where I am, and any phone numbers that don't have a country code, just add the current user's country code. But I changed my locale settings in my iPhone and it was still able to guess which country the number belongs to.</p>
  
  <p>Any idea how that's possible?</p>
  
  <p><strong>Update</strong>: Also, I just tried adding a new phone number while my phone was in airplane mode while my region settings were set to Italian while my timezone was set to Rome, Italy, and it still knew I put a US number, so it can't possibly be connecting to a server to get this info. </p>