Both the Samsung Galaxy S4 and the S3 were powerful devices when released and they remain the choice of some people today. If you bought a handset that is locked to a carrier there is good news as you can now unlock it thanks to a leaked code.
First get a new SIM card for your Samsung Galaxy S4 or S3 and insert it, then turn the device back on. Head to the dial pad and you can then type in the magic code, *#197328640# and then continue on with the steps below.
 UMTS >  Debug Screen >  Phone Control >  Network Lock > Options  Perso SHA256 OFF.
Hang on for 30 seconds and you can then go back into the main menu and you should see Network Lock. Select  NW Lock NV Data INITIALLIZ, you should now have a handset that is unlocked.
The code may work with other handsets belonging to Samsung, including the Samsung Galaxy Note 3 and Note 2.