Dating itself is not illegal for a 20-year-old and a 17-year-old anywhere in the United States. The legal question is about sexual contact, and the answer depends on the state. In states where the age of consent is 16, a sexual relationship between them is generally lawful. In states where the age of consent is 17, the 17-year-old is at the threshold and consent is possible. In states where the age of consent is 18, sexual contact is a crime unless a close-in-age exemption applies. Federal law adds a separate layer of risk anytime phones, texts, or photos are involved.
Where the Age of Consent Falls
Every U.S. jurisdiction sets a minimum age at which a person can legally consent to sexual activity. That age ranges from 16 to 18 depending on the state. Below the threshold, sexual contact with a minor is a crime regardless of whether the minor appeared willing, because the law treats people under that age as unable to give meaningful consent.
For a 20-year-old and a 17-year-old, this single number does most of the work:
- If the state’s age of consent is 16 or 17, the 17-year-old can legally consent, and a sexual relationship with a 20-year-old is not, by itself, criminal.
- If the state’s age of consent is 18, the 17-year-old cannot legally consent, and sexual contact is a criminal offense unless a close-in-age provision protects the older partner.
Penalties for violating age-of-consent statutes scale with the conduct and the minor’s age, and they can run from misdemeanors to serious felonies. A defendant’s belief that the minor was old enough is not always a valid defense; in many states, prosecutors do not need to prove the older person knew the minor’s actual age.
Close-in-Age and Romeo and Juliet Exemptions
Because two young people dating each other is different from an adult targeting a child, many jurisdictions have close-in-age exemptions. These provisions prevent or reduce criminal liability when both people are young and the age gap falls within a specified range, typically two to five years. A three-year gap between a 20-year-old and a 17-year-old sits inside the range some states allow and outside the range others allow.
The protection is not uniform. In some places, a close-in-age situation is a complete defense, meaning no crime occurred. In others, the conduct remains illegal, but the exemption drops the charge from a felony to a misdemeanor or removes the requirement to register as a sex offender. Some exemptions only function as a defense raised during prosecution, not as a bar to charges being filed. And some set additional conditions, such as requiring the younger person to be above a certain minimum age (often 14 or 15) for the exemption to apply.
Because no two states handle this the same way, the practical rule for a 20/17 couple is to look up the exact statute in the state where they live. A three-year gap that is fully legal in one state might still be prosecutable in a neighboring one.
The Federal Layer
State law is not the only concern. Federal law makes it a crime to use any form of interstate communication, including the internet, phone calls, or mail, to persuade or entice anyone under 18 to engage in sexual activity that violates any criminal law. The penalty is a mandatory minimum of 10 years in prison and can reach a life sentence.1Office of the Law Revision Counsel. 18 US Code 2422 – Coercion and Enticement
This statute reaches situations that might look purely local. If the older partner texts the 17-year-old across a state line to arrange a meeting for sexual purposes, and the sexual activity would violate a state criminal law, that message alone can trigger federal jurisdiction. The federal statute keys off whether the underlying sexual activity would be illegal, so a couple in a state where the age of consent is 16 is in a different position than a couple in a state where it is 18.
A separate federal statute punishes sexual contact with a person between 12 and 15 years old when the older person is at least four years older, on federal land, in federal prisons, and in facilities under federal contract.2Office of the Law Revision Counsel. 18 USC 2243 – Sexual Abuse of a Minor or Ward A 17-year-old is above that statute’s age range, so it does not directly apply to a 20/17 pairing, but it illustrates how federal law can layer on top of state rules.
Photos and Texts: The Sexting Trap
This is where couples with a legal age gap most often walk into serious trouble without realizing it. Federal law defines child pornography as any visual depiction of sexually explicit conduct involving anyone under 18.3Office of the Law Revision Counsel. 18 US Code 2256 – Definitions for Chapter That definition does not care whether the image was taken consensually, whether the couple’s sexual relationship is legal, or whether the image was meant for one person’s eyes only.
A 20-year-old who receives an explicit photo from a 17-year-old partner could technically possess child pornography under federal law, even if the sexual relationship itself is legal in their state. Producing such an image, which includes the 17-year-old taking a photo of themselves and sending it, carries a mandatory minimum sentence of 15 years and a maximum of 30 years in federal prison for a first offense.4Office of the Law Revision Counsel. 18 USC 2251 – Sexual Exploitation of Children Some states have laws that reduce penalties for teen-to-teen sexting, but those state provisions do not override the federal statute. Prosecutorial discretion is the only practical buffer in many cases.
For a 20-year-old dating a 17-year-old, the safest rule is simple. No photos of that kind, sent or received, until the younger partner is 18. The legality of the underlying relationship offers no protection here.
When Authority Raises the Age
Many states raise the effective age of consent when the older person holds a position of trust or authority over the younger one. Teachers, coaches, counselors, clergy, foster parents, and similar figures can face criminal charges for sexual contact with someone in their care even after that person has reached the general age of consent. In these situations, the age of consent effectively rises to 18 or 21 depending on the state.
For a 20-year-old, this most often becomes relevant if they are a coach, tutor, camp counselor, teaching assistant, or supervisor of a 17-year-old. The general state age of consent may not save them if a specific authority-based statute applies.
What a Conviction Costs
Convictions for age-related sexual offenses carry consequences well beyond the sentence itself. Depending on the state and the specific offense, a conviction can range from a misdemeanor with probation to a felony with decades of imprisonment. The collateral consequence that reshapes life most profoundly is mandatory sex offender registration.
The federal Sex Offender Registration and Notification Act (SORNA) sets a three-tier system that determines how long a person must remain on the registry:5Office of the Law Revision Counsel. 34 US Code 20911 – Relevant Definitions, Including Amie Zyla Expansion of Sex Offender Definition and National Sex Offender Rafael Resendiz-Ramirez Act
- Tier I is the default category for offenses that do not meet the criteria for a higher tier. Registration lasts 15 years, reducible to 10 with a clean record.
- Tier II covers more serious offenses punishable by more than one year of imprisonment, including sex trafficking of minors, enticement of minors, and production or distribution of child pornography. Registration lasts 25 years.
- Tier III is reserved for the most severe offenses, including aggravated sexual abuse and sexual contact with a child under 13. Registration is for life.
The registration clock starts when the person is released from prison, or at sentencing if no prison time is imposed.6eCFR. 28 CFR 72.5 – How Long Sex Offenders Must Register While registered, a person faces restrictions on where they can live, where they can work, and how close they can be to schools or parks, plus regular reporting to law enforcement and public listing of their information. A 20-year-old convicted under the wrong statute for a relationship with a 17-year-old can carry those constraints for a decade or longer.
A criminal case is not the only exposure. The minor’s parents or guardians can pursue civil lawsuits for damages, alleging intentional infliction of emotional distress, assault, or battery, and can seek therapy costs, emotional harm, and punitive damages. Civil cases use a lower burden of proof than criminal cases, so an acquittal in criminal court does not end the risk of a civil judgment based on the same conduct.
What About Marriage
Marriage is a separate question with tighter rules. Every state except two sets the baseline marriage age at 18 without parental or judicial approval. Some states have eliminated all exceptions, while others still permit marriage at 15 or 16 with parental consent, and a few technically set no minimum age when both parental and judicial approval are obtained. The recent trend has been toward tightening these rules. A 20-year-old and a 17-year-old who want to marry rather than date will need to check whether their state allows it and what approvals are required.
Practical Takeaways
Three questions decide whether a 20/17 relationship is safe from criminal exposure. What is the age of consent in the state where the couple lives, and if it is 18, is there a close-in-age exemption that covers a three-year gap? Does the older partner hold any position of authority (coach, tutor, supervisor, counselor) over the younger one? And are the two exchanging any sexual images or arranging sexual activity through texts, calls, or online messages that might cross a state line?
A clean answer to all three, in a state where the age of consent is 16 or 17, means dating and a sexual relationship are generally lawful. A single wrong answer, especially on the images question, can convert a legal relationship into a federal case. Confirming the exact rule in the state where the couple lives is worth doing before assuming.