What Is the Principle of Legality in Criminal Law?

The principle of legality in criminal law is the rule that the government cannot punish you for conduct unless a written law prohibited that conduct, and set a penalty for it, before you acted. It is the reason prosecutors have to point to a specific statute, the reason legislatures cannot criminalize behavior after the fact, and the reason judges cannot invent new crimes on their own. Several constitutional provisions and judicial doctrines carry out this single idea.

No Crime Without a Prior Law

The oldest expression of the principle comes from the Latin phrase nullum crimen, nulla poena sine lege: no crime and no punishment without a pre-existing law. Before the state can charge you with an offense, the legislature must already have defined that offense in a statute and attached a specific penalty. Conduct that was legal yesterday cannot be made criminal today and then used to prosecute you for yesterday’s behavior.

The point is not only to spare individuals from surprise prosecutions. It forces the government to publish the rules in advance so that people can plan around them. A state that could criminalize behavior after the fact could target almost anyone by inventing an offense that matches something they already did. Tying criminal liability to written, prospective statutes is what blocks that move.

No Retroactive Criminal Laws

The U.S. Constitution gives the principle teeth through two clauses that prohibit ex post facto laws. Article I, Section 9 bars Congress from passing them, and Article I, Section 10 imposes the same restriction on the states.1Congress.gov. ArtI.S9.C3.3.1 Overview of Ex Post Facto Laws An ex post facto law is one that reaches backward in time to make conduct criminal or to worsen the consequences for someone who already committed an offense.

In the 1798 case Calder v. Bull, the Supreme Court identified four kinds of laws these clauses forbid. A law is unconstitutional if it makes previously innocent conduct a crime, increases the seriousness of an offense after the fact, imposes a harsher punishment than what applied when the crime occurred, or changes the rules of evidence to make conviction easier than it would have been at the time.2Justia. Calder v. Bull, 3 U.S. 386 Those four categories still frame how courts analyze ex post facto challenges today.

The reasoning is simple. You cannot be expected to follow a law that does not yet exist. If Congress passed a statute tomorrow making it a felony to have bought a certain product last year, every past buyer would face criminal liability for something they had no reason to avoid.

When a Civil Label Hides a Punishment

Legislatures sometimes label a retroactive requirement as a civil regulation rather than a criminal penalty, which raises the question of whether the Ex Post Facto Clauses still apply. The Supreme Court addressed this in Smith v. Doe, a 2003 case about Alaska’s retroactive sex offender registration law. The Court set out a two-step test: first, decide whether the legislature intended the law to be civil or punitive; if punitive, the clause applies and the analysis ends. If the legislature intended a civil regulatory scheme, a court then asks whether the law is so punitive in its actual effect that it overrides the civil label.3Justia. Smith v. Doe, 538 U.S. 84

To decide whether a nominally civil law crosses that line, courts weigh factors drawn from the 1963 case Kennedy v. Mendoza-Martinez, including whether the law imposes a significant burden, whether the sanction has historically been treated as punishment, whether it requires wrongful intent, and whether it looks excessive compared with its stated non-punitive purpose.4Justia. Kennedy v. Mendoza-Martinez, 372 U.S. 144 The bar for overriding a civil label is high. In Smith v. Doe itself, the Court found Alaska’s registration requirement was not punitive enough to trigger the Ex Post Facto Clause, even though it imposed real burdens on registrants. The dividing line between regulatory inconvenience and actual punishment is one of the most contested areas of retroactivity law.

Laws Must Be Clear Enough to Follow

A criminal statute no one can understand is nearly as dangerous as no statute at all. The void-for-vagueness doctrine, rooted in the Due Process Clauses of the Fifth and Fourteenth Amendments, requires that criminal laws be written clearly enough for an ordinary person to know what they prohibit. The Supreme Court stated the standard in Grayned v. City of Rockford: because people are assumed to be free to do anything the law does not forbid, laws must give a person of ordinary intelligence a reasonable opportunity to know what conduct is off-limits.5Legal Information Institute. Grayned v. City of Rockford, 408 U.S. 104

Vagueness does more than leave people guessing. A vague law hands wide discretion to police, prosecutors, and judges, who end up deciding on a case-by-case basis what the statute actually covers. That invites inconsistent and biased enforcement. A law banning “annoying behavior” in public, for example, gives officers a license to arrest whoever they find disagreeable while leaving identical conduct by others alone. Courts strike down laws like that not because the underlying goal is wrong but because the language supplies no real standard.

Vague statutes also damage constitutional freedoms indirectly. When unclear language brushes up against First Amendment activity, people tend to avoid not only the forbidden conduct but a wide zone of protected activity around it. Unclear boundaries make self-censorship rational, which is why courts apply heightened scrutiny to vague laws that touch speech, assembly, or religion.5Legal Information Institute. Grayned v. City of Rockford, 408 U.S. 104

Ambiguity Is Read in the Defendant’s Favor

Even carefully drafted statutes sometimes contain ambiguous language. When a criminal law can genuinely be read in more than one way after a court has exhausted the normal tools of interpretation, the rule of lenity tells the court to choose the reading that favors the defendant. The logic tracks the broader principle: if the legislature wanted to criminalize certain conduct, it had to say so clearly enough that a court does not have to guess.

Lenity is also a check against judicial lawmaking. Without it, a judge facing an ambiguous drug trafficking statute could pick the broadest possible reading and effectively expand the law beyond what the legislature wrote. That would let judges create crimes through interpretation, which is supposed to be the legislature’s job. Lenity pushes the other way: read the statute narrowly, and if the legislature disagrees, it can amend the text.

Courts disagree about how much ambiguity triggers lenity. Some federal circuits apply it whenever reasonable doubt about meaning survives a look at the text and structure. Others require what the Supreme Court has called “grievous ambiguity.” The Supreme Court has not definitively settled which standard governs, so lenity’s practical force varies depending on which circuit hears your case.

Only Legislatures Can Create Crimes

The principle of legality assigns the power to define criminal offenses to the legislative branch. Courts cannot invent new crimes through case law, and the executive branch cannot do it through policy directives. Legislatures are elected bodies that debate proposed laws publicly and vote on the record. A prosecutor or judge who could unilaterally decide what counts as criminal would be exercising that power without democratic accountability.

In the federal system, this is absolute. The Supreme Court settled the question in 1812 in United States v. Hudson and Goodwin, holding that federal courts have no jurisdiction to try common law crimes. Congress must first define an act as a crime, attach a punishment, and designate a court with jurisdiction.6Legal Information Institute. United States v. Hudson and Goodwin, 11 U.S. 32 No federal prosecution can proceed for conduct that is not explicitly prohibited by a federal statute.

The state-level picture is less uniform. Most states have abolished common law crimes by legislation, meaning prosecution requires an offense defined in the state’s criminal code. A handful of states still recognize common law crimes to some degree, preserving the possibility that a court could treat conduct as criminal without a specific statute. The trend has moved decisively toward codification, but the holdouts show that the principle of legality in state criminal law is not as airtight as it is federally.

Agencies and Criminal Rules

Federal agencies regulate large parts of daily life, and when agency rules carry criminal penalties, the principle of legality bears on how much interpretive leeway those agencies get. If an agency can read an ambiguous statute to mean whatever it wants, the practical effect is close to writing the law itself.

For forty years, the Chevron doctrine told courts to defer to an agency’s reasonable interpretation of an ambiguous statute it administered. That changed in 2024, when the Supreme Court overruled Chevron in Loper Bright Enterprises v. Raimondo. The Court held that the Administrative Procedure Act requires courts to exercise independent judgment on whether an agency has stayed within its statutory authority; they can no longer defer simply because a statute is unclear.7Supreme Court of the United States. Loper Bright Enterprises v. Raimondo, No. 22-451 The decision leaned on the text of the APA itself, which directs courts to “decide all relevant questions of law” when reviewing agency action.8Office of the Law Revision Counsel. 5 U.S. Code 706 – Scope of Review

Loper Bright did not strip agencies of all interpretive weight. A court can still find an agency’s reasoning persuasive on its merits, and when Congress explicitly delegates a specific decision to an agency, courts respect that delegation. What ended is the automatic thumb on the scale that Chevron gave agencies whenever a statute was ambiguous.

A related concern is the nondelegation doctrine, which requires Congress to supply an “intelligible principle” to guide an agency when it hands off regulatory power.9Constitution Annotated. ArtI.S1.5.3 Origin of Intelligible Principle Standard The Supreme Court has applied that test with a light touch, and Congress has almost always been found to have given enough guidance. But when the delegation lets an agency decide what conduct carries criminal penalties, the tension sharpens. Giving an agency open-ended authority to create crimes raises the same concern that drove Hudson and Goodwin: someone other than the people’s elected representatives is deciding what warrants prison time. Whether criminal delegations should receive stricter scrutiny is a question the Supreme Court has not yet directly answered.

Raising a Legality Challenge

Knowing these protections exist is different from knowing how to invoke them, and the procedural path depends on your situation.

The most common scenario is a criminal defendant arguing that the statute under which they are charged is unconstitutionally vague or was applied retroactively. That challenge happens inside the criminal case, usually through a motion to dismiss the indictment or a motion to suppress evidence obtained under the defective statute. If the trial court denies the motion and you are convicted, the issue is preserved for appeal.

You do not always have to wait to be charged. A pre-enforcement challenge lets you ask a court to declare a statute unconstitutional before prosecution begins. To bring one, you need standing under Article III, which means showing that you intend to engage in conduct the statute covers and that there is a credible threat the government will enforce it against you.10Constitution Annotated. Advisory Opinions and Declaratory Judgments A hypothetical fear of prosecution is not enough. Courts look for concrete indicators like a history of enforcement against similar conduct, warning letters, or the government’s refusal to disclaim prosecution. The federal Declaratory Judgment Act authorizes courts to issue binding declarations about a statute’s validity when the dispute is real.

For someone already convicted and serving a sentence, the options narrow. A direct appeal is the standard route. If the conviction became final years ago and a new legal development calls its validity into question, a habeas corpus petition may be available. Federal inmates can use 28 U.S.C. § 2255 to challenge the legality of a sentence, and in limited circumstances the statute’s savings clause allows a traditional habeas petition when the § 2255 process is inadequate. Federal circuits split on exactly when the savings clause applies, particularly when the claim rests on a new court decision rather than new evidence, so the availability of this remedy depends partly on where you are imprisoned.