How can I unlock my iPhone and use an alternative SIM from another mobile provider?
In this article we show you how to unlock all iPhones, including how to unlock iPhone 4, how to unlock iPhone 5, and how to unlock the iPhone 5s and iPhone 5c. The guide includes how to unlock an iPhone for free with a free unlock code from your mobile phone company; how to get an old iPhone 4s unlock code to make old iPhones work on new networks; and how to unlock an iPhone without a jailbreak. You can get a free and legal unlock code from your network and unlock your iPhone - we show you how. 

How to unlock an iPhone: Escaping your network

If you've bought a second-hand iPhone, or inherited one from a friend or family member who has updated their iPhone to a newer model, you may be wondering why your iPhone 4 (say) isn't working on your mobile network. This is likely to be because your iPhone is tied to O2, or Vodaphone, or another network. New iPhones are often SIM-locked to a particular carrier, meaning that the iPhone only works with a SIM card provided by the same carrier. In order to use the iPhone you will need to unlock it.
Having identified that the reason your iPhone doesn't work with your network is that it is locked, you will be wondering how to unlock it. How do I unlock my iPhone 4? How can I get my iPhone 5 to work with my network? These are common questions. iPhone SIM unlocking gets around this problem, enabling you to use any SIM card in your iPhone. Luckily it's easy to unlock your phone if you follow these tips.
Many people think iPhone unlocking is difficult, or illegal, and the suspect-looking shops that specialise in SIM card unlocking don't do much to suggest that iPhone unlocking is a legitimate practice. But you can get free iPhone unlock codes from your mobile phone operator, and it's all above board. We will show you how.
See also:
How to unlock an iPhone: iPhone 5s

How do I unlock an iPhone 4, 4s, 5, 5s, or 5c?

iPhone unlocking can transform an old iPhone. Knowing how to unlock an iPhone 3GS, for example, can get you a great older iPhone at a bargain price. This tutorial will show you how to unlock you old iPhone. With your unlocked iPhone 4 or later you can use a SIM card from any network in your iPhone.

Can I unlock my iPhone?

The good news is that it's usually possible to unlock the iPhone. The bad news is that sometimes it's not so easy as it might be with other iPhone models. It depends on the phone's circumstances and your mobile phone provider.
Sometimes your network will unlock the phone for free, especially if the phone is no longer in its initial contract period. However if you haven't finished paying for the phone on your initial contract then the provider may not give you an unlock code when you move to a different provider. In which case you can attempt to unlock the phone yourself, but this may not be as cheap or easy as you'd like.

Is it legal to unlock an iPhone?

Yes. In most instances, it is perfectly legal to unlock an iPhone in the UK. Especially if you own the phone outright and have fully paid any outstanding contract. The grey area arises when you own a phone on a contract and you are still paying the contract.
If you've bought an iPhone 5S on a 24-month contract, then the monthly fee is paying for both the handset and the call allowance. This is the reason why the lock exists in the first place, and if you wish to unlock an iPhone you should check with the carrier first. Some carriers will still unlock your iPhone even if you are under contract, although they may charge a small amount first.

Do all iPhones need unlocking?

No. Apple sells many iPhones in the UK unlocked, and they can be used on all networks. Typically an iPhone that you have picked up from the Apple Store will be unlocked, and you can use it on any network. An iPhone that you have purchased from a carrier, such as O2, Three or Vodafone, will often be locked to that network.
See

How do I know if my iPhone is locked?

The easiest way to find out if the iPhone is locked to a network is to insert a SIM card from another network into the iPhone and see if it can make a call. Ask a friend with an iPhone if you can borrow their SIM card - it will need to be the right kind of SIM card to fit in your phone - the iPhone 4 and iPhone 4s use a Micro SIM and the iPhone 5 and 5s use a newer Nano SIM, so it's best to find a friend with the same phone.
If it can use a SIM card for a different mobile network then the iPhone is unlocked, and you're good to go. You can remove the SIM card using a SIM ejector tool (or straightened paperclip).
iPhone SIM cards

How to Unlock an iPhone: contact your carrier

Three Mobile: Call 333 from the iPhone or 0843 3733 333 from a landline.
Virgin Mobile: Call 789 from the iPhone or 0845 6000 789 from a landline.
Tesco: Phone Tesco on 0845 300 6600.
If you are a PAYG (Pay As You Go) customer you must have had the phone activated for more than 12 months. It is free to unlock. Pay monthly customers are charged £20 if they are still under contract, and it's free after the contract has ended.
Orange: Call 450 (PAYG customers) or 150 (Pay monthly).
With Orange, you are able to unlock your iPhone after 6 months, provided you are a current Orange or EE customer and have owned the iPhone for six months or longer. Your account must be in good standing. Orange charges £19.57 for unlocking.
T-mobile: Call 0845 412 5000 and request a Network Subsidy Code.
Vodafone: Call 08700 77 66 55 or 191 from your iPhone.
How to unlock your iPhone

Get your new carrier to unlock your old phone

Sometimes your new carrier will unlock the phone for you. EE, for example, will unlock your phone for an admin fee of £20.42. You must be an EE customer for at least six months, however, and they insist on the following criteria:
  1. You must be a current customer who's had the account for at least six months
  2. The IMEI must not be blacklisted (we'll check this for you)
  3. Pay monthly customers must have an account balance of zero - everything needs to be paid up to date
The first and best way to unlock the iPhone is to contact your carrier. If you request the iPhone unlocking then they will be able to do it at their end. You will have to wait around seven days for the unlock to work, but this is the easiest method.
This method works best when you have the SIM card for the original phone. Use it while performing the unlock process.

How to update your iPhone once it has been unlocked

Once your phone has been unlocked you will receive a confirmation on the phone unlocking from the carrier. Now follow these steps:
  1. Power down the phone. Hold down the Sleep/Wake button and move your finger across.
  2. Use the SIM card tool (or a straightened paper clip) to eject the SIM card holder from the side of the phone.
  3. Remove the old SIM card from the SIM card holder. Place your new SIM card into the SIM card holder.
  4. Reinsert the SIM card holder into the iPhone.
The SIM ejector tool

How do I update an unlocked phone without the SIM card?

If you've requested an unlock from your carrier, but have not got the original SIM card, you will need to reset the phone before it will be unlocked. First ensure that you have requested an unlock from the carrier. Now follow these steps
  1. Back up your iPhone. Either using Backup (Settings > iCloud > Storage & Backup > Back Up Now) or by connecting the iPhone to a computer and Using iTunes to perform a backup.
  2. Erase your iPhone. Click on Settings > General > Reset > Erase All Content and Settings.
  3. Complete the setup assistant and restore from your backup.
The iPhone should now be unlocked.
If you have a SIM card from a carrier that is different from your current carrier, and you've received confirmation from your current carrier that your iPhone is unlocked, follow these steps:
  1. Eject your SIM card and insert a new SIM card.
  2. Complete the setup process.
  3. If you do not currently have another SIM card you can use, follow these steps to complete the process:
  4. Back up your iPhone.
  5. Erase your iPhone.
  6. Complete the setup assistant and restore your backup.

Using an iPhone unlocking service

An alternative to contacting your carrier and asking them to unlock the iPhone is to use a mobile phone unlocking service. There are many retailers in most areas who will arrange an unlock code for a small fee (usually around £25). Although they aren't always reputable, you can also find online services that will unlock your iPhone. MobileUnlocked.com is a leading unlock retailers in the UK and according to Trust Pilot it has a good reputation (9.7/10). Another service that That Trust Pilot reports as okay (8.5/10) is Official Unlock Phone.co.uk.

How much should I pay to unlock my iPhone?

Ideally you shouldn't pay anything to unlock your iPhone, because your carrier should unlock it for you for free. But some carriers are making admin charges of around £20. Third-party companies seem to charge between £10 and £25 to unlock an iPhone, and we wouldn't pay over £25 to unlock an iPhone. Shop around if anybody quotes you a higher price than that.