If your iPhone is locked to a particular network, it can be truly frustrating. Some iPhones will only work with a SIM card provided to the carrier they're locked to – O2, EE, Three or Vodafone, for example. But there are other ways to unlock your iPhone so that you can use any SIM card. Here, we show you how.

Some iPhones are easier to unlock than others, depending on the carrier and the phone's circumstances. Most iPhones purchased within the past few years will actually be unlocked already, but if your iPhone is older, your mobile phone provider should be able to unlock the phone - and in a lot of circumstances, it's free.

You'll discover that your iPhone has been locked to a particular network if you insert a SIM card from another network into the iPhone and attempt to make a call. If it doesn't work, it's likely that your iPhone is locked to your network. You might see an error messages such as "Invalid SIM," "PAYT Lock," "SIM Card Not Accepted," "Enter SP Code," or "Insert Correct SIM Card."

Unlocking your iPhone is completely legal if you purchased the device unsubsidised or have finished paying for your contract. However, if you're still paying for your contract, you technically don't own the iPhone, so you really should check with your carrier before unlocking it.

Here, we've got a list of popular UK carriers and how to go about getting your iPhone unlocked by them, along with a handful of the best third-party options.

Unlock an iPhone on EE

To unlock your EE iPhone, you'll need to have had your account for at least six months, and you'll need to have paid all of your bills to date. EE says it'll take around 72 hours to unlock your iPhone, and it'll cost you £8.99.

If you're happy with that, you'll need to fill out the online form.

However, if you're not an EE customer and you've got an iPhone that's locked to EE, you'll need to find out the name of the original owner, their EE phone number and any additional account information you can acquire in order to unlock the iPhone.

EE says that any iPhone or iPad sold by EE on or after 1 September 2015 will be unlocked automatically when the device reaches 18 months old.

Unlock an iPhone on O2

O2 requires you to use the My O2 Online or My O2 app to unlock your iPhone. If you're a Pay Monthly customer you can unlock your iPhone at any time, but you'll still need to finish paying for your contract. The same goes for Pay As You Go customers.

You'll need to connect your iPhone to iTunes once you've inserted the new, non-O2 SIM to complete the unlock process. 

If that fails to unlock the iPhone, you'll need to use O2's form or a third party unlocking service like those described below.

Unlock an iPhone on Three

On Three's website, the company states that all iPhones purchased after 1 January 2014 from Three will be unlocked as soon as you activate it over WiFi or connect it to iTunes on your computer, so there's no need to do anything to use another network.

However, in order to unlock an iPhone running iOS 7 or above that wasn't purchased from Three recently, you'll need to connect to iTunes and do a restore of your device to unlock it.

It's important to back up your content first, as restoring your device will wipe all of the data.

For older iPhones, you'll need to fill out Three's online form

Unlock an iPhone on Virgin Mobile

Any iPhone purchased from Virgin Mobile recently will be unlocked, and can be used with other SIMs. However, some older iPhones may be locked to Virgin Mobile, but you'll just need to update your iPhone to the latest version of iOS to automatically unlock your iPhone.

Alternatively, if your iPhone isn't compatible with iOS 8 or newer, you can perform a full restore of your iPhone just like you can if you're unlocking from Three.

If you're still having trouble, Virgin Mobile will be able to assist you in the unlocking process if you purchased the iPhone directly from the company. You'll need to get in touch with them by calling 150 on your Virgin Mobile phone.

Unlock an iPhone on Vodafone

Vodafone also requires you to have an account with the company or know the details of the person who had the account before.

If you do know those details, you'll need to fill out Vodafone's online form. The company says it'll get back to you within 48 hours, but it could take up to 10 days if there's an issue that requires getting in touch with the phone's manufacturer.

Unlocking through Vodafone is free to all customers, regardless of whether you're on contract or Pay as You Go.

Unlock an iPhone on Tesco Mobile

Tesco's website says it's free to unlock your iPhone, although some newer models may not be able to be unlocked straight away.

You just need to fill out the online unlocking request, and you should get a text within seven days that gives you a code and a link for unlocking.

Third-party unlocking services

You don't have to go through your carrier to unlock your iPhone, though we think it's better if you can. If that's not possible, you can use an unlocking service, but please watch out as we've heard from some readers who've been slapped with extra charges throughout the process.

If you really want to use an online service, please read all of the small print before you enter your payment details. There are plenty out there to try and many will refund you if it doesn't work. We trust and recommend Doctor SIM, which was able to unlock a Galaxy S6 which other sites failed to unlock.

You could also try Express Unlock, starting at £14.99.

The Final Step

When your carrier has agreed to unlock your iPhone and has processed your request, you'll need to replace the old SIM card with a SIM card of the carrier you wish to change to. Make sure your iPhone is off when you do this, and when you turn your iPhone back on it will talk you through any further updates that may be required.

If you don't have the original SIM card but have requested for your iPhone to be unlocked by the original carrier, you'll need to reset your device.

Make sure you back up your iPhone by connecting it to your computer and using iTunes to perform a backup, and then completely reset your device by going to Settings > General > Reset > Erase All Content and Settings. Everything will be wiped from your iPhone following this process, so backing up your iPhone is EXTREMELY important to do first.

You can now complete the setup assistant on your iPhone and restore your iPhone from the backup you created. Insert your new SIM card. This should mean that your iPhone is now unlocked.

You might also like: Best SIM-only contract deals.