This chapter considers what counts as illegality and the effect of illegality on a contract (and consequent restitution). The approach of the Courts to illegality has been transformed for the better, and simplified, by the Supreme Court in Patel v Mirza in 2016. Illegal conduct, tainting a contract, can vary widely from serious crimes (eg murder) to relatively minor crimes (eg breach of licensing requirements) through to civil wrongs and to conduct that does not comprise a wrong but is contrary to public policy. As regards the effect of illegality, where a statute does not deal with this, the common law approach is now to apply a range of factors. A final section of the chapter examines contracts in restraint of trade.