Different networks have different processes for obtaining PAC codes, which you need to port a number in the United Kingdom.
You can find out how to find out your PAC code below:
For EE:
Call 150 from an EE mobile phone
Call 079 5396 6250 from any other phone
For Three:
Call 333 from a Three phone
Call 033 3338 1001 from any other phone
For O2:
Call 202 from an O2 phone
Call 034 4809 0222 from any other phone
For Virgin Mobile:
Call 789 from a Virgin Mobile phone
Call 034 5600 0789 from any other phone
For Vodafone:
Call 191 from a Vodafone phone
Call 033 3304 0191 from any other phone
For BT Mobile:
Call 150 from a BT Mobile phone
Call 0800 800 150 from any other phone
For Plusnet Mobile:
Call 500 from a Plusnet Mobile phone
Call 080 0013 2632 from any other phone
For ID Mobile:
Call 7777 from an ID Mobile phone
Call 033 3003 7777 from any other phone
For Tesco Mobile:
Call 4455 from a Tesco Mobile phone
Call 034 5301 4455 from any other phone
For Sky Mobile:
Call 033 0041 2639 from Sky Mobiles, phones registered to other networks and landlines
For giffgaff:
giffgaff doesn't operate customer support helplines. However, visit giffgaff.com and contact customer support
For VOXI:
Visit VOXI's contact page.
For Lebara:
Ring 5588 from your Lebara mobile.
Ring 020 7031 0791 from all other networks or from your landline.
For Ecotalk:
Ring 033 3800 5500 from any UK mobile or landline.