The range of Samsung handsets is powerful and so many people choose them, but many take them with a carrier that locks the handsets to them. This means that if you want to sell the device when you upgrade, or if you want to move it to a better deal with another carrier, you have to unlock it first. Luckily there is an unlock code leaked online that means you can break your handset free and you have nothing to pay.
The code that has leaked is said to work on a number of devices, including the Samsung Galaxy S4 and many others.
If you want to go ahead and unlock your Samsung Galaxy S4 you can turn the handset off and insert a new SIM card. You can then turn the device back on and go to the dial pad and enter *#197328640#. You should then check the steps below to continue unlocking your device.
 UMTS >  Debug Screen >  Phone Control >  Network Lock > Options  Perso SHA256 OFF.
You should now wait for 30 seconds and you can then choose back and head back into the main menu and here you should see Network Unlock. Select  NW Lock NV Data INITIALLIZ and your device should be unlocked. The unlock code is also said to work with many of Samsung handsets, including the Samsung Galaxy S4.