According to the phone manufacturer, unlocking the Apple iPhone 5 can be accomplished by contacting your cellular service carrier and requesting the carrier unlock the device. In some cases, the carrier may require you to pay a fee pursuant to the terms of your service contract to unlock the device.
Each cellular service carrier has its own policies regarding device unlocking. Apple maintains a listing of all carriers who support the iPhone on its Support website. Users should consult this website to determine if their carrier allows them to unlock their iPhone, and if so, what restrictions, if any, the carrier places on the unlock. If the carrier does support phone unlocking the user should contact the carrier to request the unlock. In some cases the carrier can perform the unlock itself remotely, while others require a code to be recorded and manually entered into the phone by the user.
Alternative methods for unlocking exist, but Apple users should be cautious, as these methods are not supported by Apple. Moreover, any unsupported service actions taken with the phone may result in their warranty being voided, as well as potentially permanent damage to the phone. Unlocking a phone does not remove or cancel any financial obligation that a customer has to a carrier.
Phone unlocking is not legal in all jurisdictions, according to HowStuffWorks. Users should check with local regulatory authorities before attempting to unlock their devices.