If the contract is illegal, it must be invalid. Because the law stipulates that a contract that violates the mandatory provisions of laws and administrative regulations is invalid, and the contract has no corresponding legal effect from the beginning. Therefore, the contract is invalid if it is illegal.
Article 144 of the Civil Code [Effectiveness of civil juristic acts performed by persons without civil capacity] Civil juristic acts performed by persons without civil capacity are invalid.
Article 146 of the Civil Code [Effect of False Representation and Concealment] A civil juristic act performed by the actor and the counterpart with a false declaration of intention is invalid.
The validity of a civil juristic act concealed by a false declaration of intention shall be dealt with in accordance with the provisions of relevant laws.
Article 153 of the Civil Code [Effect of civil legal acts violating mandatory provisions and public order and good customs] Civil legal acts violating mandatory provisions of laws and administrative regulations are invalid. However, the exception is that the mandatory provisions do not invalidate the civil juristic act.
Civil juristic acts violating public order and good customs are invalid.
Article 154 [malicious collusion] of the Civil Code The civil legal act of malicious collusion between the actor and the counterpart, which damages the legitimate rights and interests of others, is invalid.