Key Takeaways

  • Illegal contracts are void and unenforceable because they violate statutory law or public policy.
  • Courts distinguish between contracts that are inherently illegal and those that become illegal due to their performance or external laws.
  • Certain exceptions, such as withdrawal before performance, allow limited recovery under illegal contracts.
  • Courts weigh factors such as proportionality, knowledge of illegality, and public interest in deciding whether to void a contract.
  • Illegality can arise from statutes, licensing violations, criminal intent, or unethical purpose—not just express prohibitions.
  • The "Lesser Evil" principle may permit enforcement of an illegal contract to prevent a greater legal or societal harm.

An illegal contract is an agreement that violates the law because its fulfillment requires the parties to engage in illegal activity. Such a contract is void and unenforceable from the get-go. Thus, if the contract is breached, neither party will be entitled to any compensation or held liable.

It is important to note that a contract can be illegal without violating the law. For example, this can occur when a contract deals with certain activities, like gambling or prostitution, that are not explicitly prohibited by law but are discouraged due to violation of public policy.

While a void contract could still be legal, an illegal contract is usually void.

Types of Illegal or Invalid Contracts

For a contract to be valid, it must include required elements―an offer and acceptance. The terms of the offer made by one party must be clearly stated in the contract, and the other party must accept those terms willingly. The offer, also called “a consideration," could come in the form of money, goods, or services. Both parties must have complete comprehension of the implications of their agreement.

A contract could be illegal because of the following reasons:

  • Lack of capacity: If one party does not have mental capacity to understand fully the effect of the contract, like in case of a senior with dementia, a mentally handicapped person, or a small child.
  • Illegal purposes: If a contract is made to perform an illegal activity, like selling drugs.
  • Mistaken interpretation: If either or both parties have incorrect understanding of the terms of a contract.
  • Misrepresentation and fraud: If a contract contains false statements.

Contract Types Deemed Illegal by Statute or Policy

Some contracts are illegal because they are prohibited by statute, while others are unenforceable because they contravene public policy. Common categories include:

  • Criminal Contracts – Agreements involving drug trafficking, gambling (where illegal), or contracts for murder-for-hire.
  • Regulatory Violations – Agreements made without required licenses (e.g., unlicensed medical practice, construction).
  • Contracts to Defraud – Agreements to commit fraud against a third party or the government.
  • Restraint of Trade – Non-compete agreements or exclusivity contracts that violate antitrust laws.
  • Contracts Against Public Morality – Includes agreements for immoral services (e.g., prostitution, in jurisdictions where illegal).
  • Usurious Loan Agreements – Contracts charging interest rates above legal thresholds.
  • Bribes and Kickbacks – Contracts involving payments to influence government or corporate decisions.

Understanding the category can help determine if an agreement falls into the realm of illegal contracts and whether courts may offer any relief.

Additional Grounds for Illegality in Contracts

Some contracts may be deemed illegal not only because of their subject matter but also due to how they were formed or executed. These include:

  • Contracts that restrain trade: Agreements that unreasonably limit business competition, such as certain non-compete clauses, may be deemed illegal under antitrust laws.
  • Usurious contracts: Loan agreements that charge interest above the legal limit may be unenforceable.
  • Contracts to obstruct justice: Any agreement to bribe a public official or to conceal evidence constitutes an illegal contract.
  • Unlicensed activity: If the performance of a contract requires a state-issued license (e.g., for contractors or medical professionals) and the party lacks that license, the contract may be illegal and void.

When Legal Contracts Become Illegal in Performance

Even if a contract appears lawful at its formation, it may become illegal during performance due to:

  • Change in Law: If a statute enacted after the contract renders its performance illegal, the contract may be terminated under the doctrine of supervening illegality.
  • Unlawful Conduct During Performance: If one or both parties engage in illegal acts while fulfilling the contract (e.g., using bribery to secure supplies), the contract becomes unenforceable.
  • Frustration of Purpose by Illegality: If the contract's objective becomes illegal (e.g., exporting goods to a sanctioned country), it may be discharged under frustration doctrines.

This distinction is important because courts are more likely to void a contract that became illegal post-formation than one that was illegal from the outset.

How to Determine That a Contract is Illegal

The subject matter of a contract determines its legal standing. For example, if gambling is illegal in some state and you hire a blackjack dealer, such an employment contract will be illegal because it requires the person to engage in illegal activity. But if state laws allow sale of playing cards, then a contract to sell cards will be legal, even if the cards are sold to a known gambler in a state where gambling is illegal.

Tests Courts Use to Identify Illegal Contracts

Courts often apply several tests to determine illegality:

  1. Statutory Violation Test – Does the contract violate a specific law or regulation?
  2. Public Policy Test – Does the contract's objective undermine societal values or the legal system?
  3. Nature of Consideration Test – Does the contract require either party to perform an illegal act?
  4. Intent of the Parties – Did either or both parties knowingly enter into an illegal agreement?
  5. Legislative Intent – Was the law violated created to protect one of the parties? If so, courts may allow recovery for that party.

If a contract fails these tests, it is generally declared void and unenforceable.

Factors Courts Consider When Evaluating Illegal Agreements

Courts assess multiple factors when deciding whether to enforce or void an illegal agreement:

  • Severity of the illegality: If the breach of law involves significant moral turpitude or public harm, the contract is less likely to be enforced.
  • Disproportionality of penalties: Courts may consider whether denying all remedies would be unfairly harsh, especially for a less-guilty party.
  • Legislative intent: If the purpose of the law violated was to protect one party (e.g., consumer protection laws), courts may still allow recovery by the protected party.
  • Public interest considerations: Some courts balance the impact of enforcement on public policy and social order—this is sometimes referred to as applying the "lesser evil principle"​.

Public Interest and Proportionality in Court Evaluations

Courts weigh public interest when deciding the consequences of illegal contracts. The factors include:

  • Disproportionate Penalty – If declaring the contract void would impose an unjust burden on one party, courts may consider equitable relief.
  • Relative Guilt – Courts may differentiate between a party who knowingly engaged in illegality versus one who was misled.
  • Deterrence vs. Fairness – While discouraging illegal conduct is important, some courts balance that against the harm of denying recovery to a less culpable party.
  • Impact on Third Parties or Society – If enforcing or voiding a contract affects broader public interests, courts may adjust outcomes accordingly.

These factors highlight the discretionary role of the judiciary in cases involving potentially illegal agreements.

Other Examples of Illegal Contracts

  • Contracts for the sale or distribution of controlled substances, like drugs
  • Contracts for illegal activities, like prostitution or gambling
  • Employment contracts for the hiring minors
  • Any contracts that go against public policy or force a party to perform labor as a slave

Contracts That Risk Civil or Regulatory Liability

Beyond criminal conduct, civil infractions and administrative breaches can render contracts illegal. Examples include:

  • Contracts with Unlicensed Professionals – Hiring a contractor or consultant who lacks mandatory licensing (e.g., real estate broker, attorney).
  • Employment Agreements Violating Labor Law – Agreements that circumvent minimum wage, overtime rules, or workplace safety laws.
  • Non-Disclosure Agreements to Hide Unlawful Activity – NDAs used to conceal fraud, discrimination, or regulatory violations.
  • Vendor Contracts in Violation of Procurement Rules – For example, government contracts awarded outside proper bidding procedures.

These contracts may not involve criminal law but still be void due to their illegality under administrative or civil statutes.

Is the Contract Void or Unenforceable Because It Is Illegal?

To avoid liability, defendants often resort to the defense of illegality or “void as against public policy.” Thus, care must be taken when drafting and entering into contracts to avoid severe consequences of contract illegality. Typically, the court won't enforce an illegal contract and will leave the parties as they are. But illegality of a contract can be raised by any party or the court at any time. In the absence of dominating public interest in voiding the contract, an illegal contract could be enforced if:

  • The party seeking the enforcement is less guilty than the other party
  • The law was violated without any serious moral turpitude
  • The other party would benefit unfairly from the contract voidance
  • The penalty would be disproportionally harsh compared to the degree of illegality

Certain situations allow a party to get relief based on quantum meruit and to recover the justified value of the rendered services or provided goods even if the illegality of the contract is proved short time after.

The law gives no assurance of compensation for services that were performed illegally under a contract but were not explicitly prohibited by law. But in cases when the services performed under an illegal contract by one party are not illegal by their nature and the other party does not deliver willingly on their part, it is possible for the former party to be compensated under a quantum meruit for the actual value of what the other party received. To protect their right to recovery in case of a breach of contract, the plaintiff must always allege a cause of action for quantum meruit every time when a contract breach is caused by nonpayment for provided services or goods.

Exceptions to the No-Enforcement Rule

While illegal contracts are generally unenforceable, courts may allow exceptions in limited circumstances:

  • Withdrawal Before Performance – A party who withdraws from an illegal agreement before any illegal action occurs may recover money or property transferred.
  • Ignorance of Illegality – If one party was unaware the contract was illegal and not equally at fault, courts may offer relief.
  • Severable Contracts – If the illegal portion of the contract can be separated from the legal parts, the enforceable terms may still be upheld.
  • Protected Class Doctrine – If a law exists to protect a particular class (e.g., consumers, employees), the protected party may still sue despite the illegality.

These doctrines reflect the courts’ reluctance to allow unjust enrichment, especially when one party is significantly less culpable.

The Lesser Evil Principle in Illegal Agreements

A growing body of legal thought, supported by judicial reasoning and academic literature, endorses what is known as the "lesser evil principle." This principle asserts that courts should assess whether enforcing an illegal agreement would result in less societal harm than voiding it. For example:

  • Enforcing a contract may be justified to avoid unjust enrichment of one party.
  • The principle supports upholding autonomy and fairness when one party is not at fault.
  • Courts may be guided by which outcome better aligns with legal integrity and public welfare​.

While not universally adopted, this approach is gaining traction in both academic and judicial arenas for providing a balanced resolution when both parties are tainted by some form of wrongdoing.

Frequently Asked Questions

  1. Can an illegal contract ever be enforced?
    Generally, no. Courts do not enforce contracts that are illegal by nature or purpose. However, exceptions exist for protected parties or if illegality can be severed.
  2. What happens if I unknowingly enter into an illegal contract?
    If you were unaware and not equally responsible for the illegality, the court may allow you to recover losses, especially if you're part of a protected class.
  3. Are oral illegal contracts treated differently from written ones?
    No. Whether oral or written, if the contract violates law or public policy, it is void and unenforceable.
  4. Can I recover money I paid under an illegal contract?
    Not usually—courts typically apply the doctrine of in pari delicto (equal fault). However, you may recover if you withdrew before the illegal act or were not at fault.
  5. How do courts decide if a contract violates public policy?
    Courts consider the societal impact, legislative intent, and whether the contract undermines the legal system or promotes harmful conduct.

If you need more information about illegal contracts, you can post your legal need on UpCounsel's marketplace. UpCounsel accepts only the top 5 percent of lawyers to its site. Lawyers on UpCounsel come from law schools such as Harvard Law and Yale Law and average 14 years of legal experience, including work with or on behalf of companies like Google, Menlo Ventures, and Airbnb.