In general, the law proscribes acts which are considered either sexual abuse, or inappropriate behavior against the social norms, within a given culture. In addition, certain categories of activity may be considered crimes even if freely consented to. Thus sex and the law varies from place to place.
Sexual acts which are prohibited by law in a jurisdiction, are also called sex crimes.
The age of consent varies from jurisdiction to jurisdiction. The median seems to range from 16 to 18 years, but laws stating ages ranging from 9 to 21 do exist. In many jurisdictions, age of consent is interpreted to mean mental or functional age. As a result, victims can be of any chronological age if their mental age is below the age of consent. Some jurisdictions forbid sexual activity outside of legal marriage completely. The relevant age may also vary by the type of sexual act, the sex of the actors, or other restrictions such as abuse of a position of trust. Some jurisdictions may also make allowances for minors engaged in sexual acts with each other, rather than a hard and fast single age. Charges resulting from a breach of these laws may range from a relatively low-level misdemeanor such as "corruption of a minor," to "statutory rape" (which is considered equivalent to rape, both in severity and sentencing).
Western cultures are often far more tolerant of acts, such as oral sex or cross-dressing, that have traditionally been held to be crimes in some cultures, but combine this with lesser tolerance for the remaining crimes. By contrast, many cultures with a strong religious tradition consider a far broader range of activities to be serious crimes.
As a general rule, the law in many countries often intervenes in sexual activity involving young or adolescent children below the legal age of consent, non-consensual deliberate displays or illicit watching of sexual activity, sex with close relatives ("incest"), harm to animals, acts involving the deceased (necrophilia), and also when there is harassment, nuisance, fear, injury, or assault of a sexual nature, or serious risk of abuse of certain professional relationships. Separately, the law usually regulates or controls the censorship of pornographic or obscene material as well.
A variety of laws protect children by making various acts with children a sex crime. These can include Age of Consent laws, laws preventing the exposure of children to pornography, laws making it a crime for a child to be involved in (or exposed to) certain sexual behaviors, and laws against child grooming and the production and ownership of child pornography (including simulated images).
Non-consensual sadomasochistic acts may legally constitute assault, and therefore belong in this list. In addition, some jurisdictions criminalize some or all sadomasochistic acts, regardless of legal consent and impose liability for any injuries caused. (See Consent (BDSM))