Go to Settings
Tap General
Tap About
Find Carrier Lock or Network Provider Lock
If it says No SIM restrictions, the iPhone is unlocked
If it shows a carrier lock, the iPhone is locked
Insert a SIM card from a different carrier
If the phone works with the new SIM, it is unlocked
If the phone shows SIM Not Supported or similar, it is locked
Contact the carrier to confirm unlock status
Check the original purchase or carrier account details for unlock information
