Yes. It is illegal to have two PANs and the penalty for such offence is Rs.10,000/-. You need to surrender to any one PAN to your assessing officer in following manner:
a. Visit the following link and fill the details in the online form given at the link and follow the instructions there http://incometax.sparshindia.com/pan/newPAN.asp
b. You can also surrender the PAN online by filing an application “change in PAN data” through UTI PAN centres or NSDL TIN Facilitation centres. In application fill spare PAN number in last row of the form.
a. Write a letter to the assessing officer under whose jurisdiction you have been filing your returns. (to know your AO, use this link: https://incometaxindiaefiling.gov.in/e-Filing/Services/KnowYourJurisdictionLink.html ). The letter must contain details such as your name, contact details, details of the PAN card to be retained, details of the duplicate PAN card(s) which you need to surrender, etc.
Keep the acknowledgement copy of the letter that you have filed with the I-T department stating that you are surrendering your additional PAN. That is sufficient as proof of surrender and no additional confirmation from the I-T authorities is required. On receipt of the acknowledgement there is no need for you to wait for intimation from the Income-tax department considering that the PAN submitted has now been cancelled by them. The acknowledgement copy of the letter submitted will more than solve the purpose.
b. Manually fill the Form No. 49A for change / correction in PAN and submit the same at your nearest UTI PAN centre or NSDL TIN Facilitation centre.