If you have bought the Samsung Galaxy S5 from a carrier you will have got it cheaper with subsidises. The down side to this is that the handset will be locked to that carrier and if you want to take it to another you will have to unlock it first. Luckily there is a way to unlock it and it doesn’t cost a thing.
To unlock your Samsung Galaxy S5 once your contract has ended you can follow the steps outlined below.
First take out your old SIM card and put a new one in.
You then have to switch the handset off and turn it back on again.
Go to the dialpad on your Samsung Galaxy S5and then enter *#197328640#.
You should then choose  UMTS >  Debug Screen >  Phone Control >  Network Lock > Options  Perso SHA256 OFF.
You will then have to wait for around 30 seconds and head back into the main menu by pressing the back key on the Samsung Galaxy S5.
When you get back into the main menu you will see something that says Network Lock and then you need to choose  NW Lock NV Data INITIALLIZ.
If everything has gone to plan you will now have the Samsung Galaxy S5 unlocked. This code is also said to work on other handsets belonging to Samsung so you may want to try it.