Legality of BDSM
Criminalization of consensual BDSM practices is usually not with explicit reference to BDSM, but results from the fact that such behavior as spanking or cuffing someone could be considered a breach of personal rights, which in principle constitutes a criminal offense. In Germany, Netherlands, Japan and Scandinavia, such behavior is legal in principle. In Austria the legal status is not clear, while in Switzerland some BDSM practices can be considered criminal. Spectacular incidents like the US scandal of People v. Jovanovic and the British Operation Spanner demonstrate the degree to which difficult grey areas can pose a problem for the individuals and authorities involved, and the importance of knowing the legal status of the right of consent in the judicial statue of the country of resident for the practitioners of BDSM. Australia 
In Australia, BDSM is illegal in the Northern Territory. BDSM pornography is banned nationwide and any pornography containing BDSM is classified RC (refused classification) in Australia. Austria 
§90 of the criminal code declares bodily injury (§§ 83, 84) or the endangerment of physical security (§89) to not be subject to penalty in cases in which the "victim" has consented and the injury or endangerment does not offend moral sensibilities. Case law from the Austrian Supreme Court has consistently shown that bodily injury is only offensive to moral sensibilities (and thus punishable) when a "serious injury" (meaning a damage to health or an employment disability lasting more than 24 days) or the death of the "victim" results. A light injury is considered generally permissible when the perceived victim has consented to it. In cases of threats to bodily well-being, the standard depends on the probability that an injury will actually occur. If serious injury or even death would be a likely result of a threat being carried out, then even the threat itself is considered punishable. Canada
In 2004, a judge in Canada ruled that videos seized by the police featuring BDSM activities were not obscene, and did not constitute violence, but a "normal and acceptable" sexual activity between two consenting adults. In 2011, the Supreme Court of Canada ruled in R. v. J.A. that a person must have an active mind during the specific sexual activity in order to legally consent. The Court ruled that it is a criminal offence to perform a sexual act on an unconscious person – whether or not that person consented in advance. European Court of Human Rights
The European Court of Human Rights has considered multiple cases involving BDSM and has upheld convictions for BDSM activities based on the principle that people cannot renounce their fundamental rights. It has ruled that "criminal law cannot, in principle, intervene in the field of consensual sexual practices which fall under the free will of individuals", but that this guideline is not applicable in especially serious cases. France
In France, consensual BDSM activities resulting in serious harm are prosecutable. Germany
The practice of BDSM is not generally penalized in Germany if it is conducted with the mutual consent of the partners involved. The following sections of the criminal code may be relevant in certain instances for BDSM practices:

| width="50%" align="left" valign="top" style="border:0"|
 Sexual assault (§177)
 Sexual abuse of persons unable to resist (§179)
 Insult and insult by deed (§185)
 Battery (§223)
| width="50%" align="left" valign="top"|
 Aggravated battery (§224)
 False imprisonment (§239)
 Coercion (§240)

To fulfill the charge of coercion, the use of violence or the threat of a "severe mistreatment" must involve an endangerment to life and limb. In cases where the continued application of the treatment could be ended through the use of a safeword, neither coercion nor sexual coercion may be charged. In the case of charges of sexual abuse of people incapable of resistance, similar principles apply. In this case, taking advantage of a person's inability to resist in order to perform sexual acts on that person is considered punishable. The potential use of the safeword is considered to be sufficient possibility for resistance, since this would lead to the cessation of the act, and so a true inability to resist is not considered to be in effect. The charge of insult (slander) can only be prosecuted if the defamed person chooses to press charges, according to §194. False imprisonment can be charged if the victim—when applying an objective view—can be considered to be impaired in his or her rights of free movement. According to §228 of the German criminal code, a person inflicting a bodily injury on another person with that person's permission violates the law only in cases in which the deed can be considered to have violated good morals in spite of permission having been given. On 26 May 2004, the Criminal Panel No. 2 of the Bundesgerichtshof (German Federal Court) ruled that sado-masochistically motivated physical injuries are not per se indecent and thus subject to §228. Still, this ruling makes the question of indecency dependent on the degree to which the bodily injury might be likely to impair the health of the receiving party. According to the BGH, the line of indecency is definitively crossed when "under an objectively prescient consideration of all relevant circumstances the party granting consent could be brought into concrete danger of death by the act of bodily injury." In its ruling, the court overturned a verdict by the Provincial Court of Kassel, according to which a man who had choked his partner and thereby involuntarily strangled her, had been sentenced to probation for negligent manslaughter. The court had rejected a conviction on charges of bodily injury leading to death on the grounds that the victim had, in its opinion, consented to the act. Following cases in which sado-masochistic practices had been repeatedly used as pressure tactics against former partners in custody cases, the Appeals Court of Hamm ruled in February 2006 that sexual inclinations toward sado-masochism are no indication of a lack of capabilities for successful childraising. Italy
For Italian law, BDSM is right on the border between crime and legality, and everything lies in the interpretation of the Code by the judge. This concept is that anyone willingly causing "injury" to another person is to be punished. In this context, though, "injury" is legally defined as "anything causing a condition of illness", and "illness" is ill-defined itself in two different legal ways. The first is "any anatomical or functional alteration of the organism" (thus technically including little scratches and bruises too); The second is "a significant worsening of a previous condition relevant to organic and relational processes, requiring any kind of therapy". This makes it somewhat risky to play with someone, as later the "victim" might call for foul play using any sort of little mark as evidence against the partner. Also, any injury requiring over 20 days of medical care must be denounced by the professional medic who discovers it, leading to automatic indictment of the person who caused it. BDSM play between nonconsenting adults or minors or in public is of course punished according to normal laws. Nordic countries
In September 2010, a Swedish court ruled that a 32-year-old man was acquitted of assault for engaging in consensual BDSM play with a 16-year-old girl (the age of consent in Sweden is 15). Norway's legal system has likewise taken a similar position, that safe and consensual BDSM play should not be subject to criminal prosecution. This parallels the stance of the mental health professions in the Nordic countries, which have removed sadomasochism from their respective lists of psychiatric illnesses. Switzerland
The age of consent in Switzerland is 16 years, which also applies for BDSM play. Children (i.e. those under 16) are not subject to punishment for BDSM play as long as the age difference between them is less than three years. Certain practices, however, require granting consent to light injuries and thus are only allowed for those over 18. Since Articles 135 and 197 of the Swiss Criminal Code were tightened, on 1 April 2002, ownership of "objects or demonstrations [...] which depict sexual acts with violent content" is punishable. This law amounts to a general criminalization of sado-masochists, since nearly every sado-masochist will have some kind of media which fulfill these criteria. Critics also object to the wording of the law, which puts sado-masochists in the same category as pedophiles and pederasts. United Kingdom
British law does not recognize the possibility of consenting to actual bodily harm. Such acts are illegal, even between consenting adults, and these laws are enforced (R v Brown being the leading case). R v Brown dismissed the defence of consent, meaning that the men charged of sexual offences could not defend their actions. It has been pointed out that people can consent to activities such as boxing and body piercing, which also result in pain, but apparently cannot consent to BDSM. This leads to the situation that, while Great Britain and especially London are world centers of the closely related fetish scene, there are only very private events for the BDSM scene which are in no way comparable to the German "Play party" scene. Operation Spanner was the name of an operation carried out by police in the United Kingdom city of Manchester in 1987, as a result of which a group of homosexual men were convicted of assault occasioning actual bodily harm for their involvement in consensual sadomasochism over a ten-year period. The resulting House of Lords case (R v Brown, colloquially known as "the Spanner case") ruled that consent was not a valid legal defence for wounding and actual bodily harm in the UK, except as a foreseeable incident of a lawful activity in which the person injured was participating, e.g. surgery. Following Operation Spanner the European Court of Human Rights ruled in January 1999 in Laskey, Jaggard and Brown v. United Kingdom that no violation of Article 8 occurred because the amount of physical or psychological harm that the law allows between any two people, even consenting adults, is to be determined by the jurisdiction the individuals live in, as it is the State's responsibility to balance the concerns of public health and well-being with the amount of control a State should be allowed to exercise over its citizens. In the Criminal Justice and Immigration Bill 2007, the British Government cited the Spanner case as justification for criminalizing images of consensual acts, as part of its proposed criminalization of possession of "extreme pornography". Following the Audiovisual Media Services Regulations 2014 the video distribution of some BDSM practices has become illegal. United States 
The United States Federal law does not list a specific criminal determination for consensual BDSM acts. Some states specifically address the idea of "consent to BDSM acts" within their assault laws, such as the state of New Jersey, which defines "simple assault" to be "a disorderly persons offense unless committed in a fight or scuffle entered into by mutual consent, in which case it is a petty disorderly persons offense". Influential court cases

People v Samuels (1967)
The defendant, identified as Samuels, was convicted in 1967 on the counts of conspiracy to produce and distribute obscene matter, two accounts of assault by means of force, and a final count of sodomy. Samuels was acquitted of the sodomy charge but was found guilty of conspiracy and one case of aggravated and one of simple assault, the latter of which was dismissed. He was sentenced to probation of 10 years and a fine of $3,000. Commonwealth v. Appleby (1978)
The defendant, Appleby, claims to have been in a consensual sadomasochistic relationship with a man by the name of Cromer. This relationship lasted approximately two years, until the nature of the relationship became more violent than what Cromer had consented to. Appleby was indicted with assault and battery with a dangerous weapon and sentenced to 8–10 years in Massachusetts Correctional Institution at Walpole. This case set precedent on the nature of consent to bodily harm. A victim's consent to assault and battery is not grounds for innocence of the crime. State v. Collier (1985)

The defendant, Collier, ran a modeling agency where the victim, Steel, was employed. After a night with friends in which she claims to have been doing drugs, Collier became angry and detained Steel in the room. As punishment, Steel was subjected to various BDSM and sexual acts. The result of this punishment lead to various physical injuries visible on the body and face. This case however, focuses less on the consent of the issue, and more on the statute of assault and the foundations of "Social Activity". The defendant testified about Steel's interest in sadomasochistic activities through books and used the information for his defense under Iowa state code Section 708.1 - which outlines assault statutes. Iowa State Code Section 708.1

2. A person commits an assault when, without justification, the person does any of the following:

a. Any act which is intended to cause pain or injury to, or which is intended to result in physical contact which will be insulting or offensive to another, coupled with the apparent ability to execute the act. b. Any act which is intended to place another in fear of immediate physical contact which will be painful, injurious, insulting, or offensive, coupled with the apparent ability to execute the act. c. Intentionally points any firearm toward another, or displays in a threatening manner any dangerous weapon toward another. 3. An act described in subsection 2 shall not be an assault under the following circumstances:

a. If the person doing any of the enumerated acts, and such other person, are voluntary participants in a sport, social or other activity, not in itself criminal, and such act is a reasonably foreseeable incident of such sport or activity, and does not create an unreasonable risk of serious injury or breach of the peaceCollier attempted to use Steel's interest in BDSM as a gateway to the defense that the actions were not assault, but a social activity. This defense did not hold up in court and was convicted of assault resulting in severe bodily injury and possession of a firearm by a felon. The assault charges were upheld in the appellate court. People v. Jovanovic (1997)
This case deals heavily with the consent defense. A Columbia University student exchanged email communications with the defendant, Jovanovic, where they extensively discussed sadomasochistic interests and a potential relationship. The emails were submitted to the court for review where they determined that the defendant already had ample access to them and would not be presented to the defense, as they were not the party to bring them forth as evidence. Upon appeal, the higher courts decided that the evidence was improperly handled under the state of New York's rape shield law. The defendant won the appeal and the conviction for kidnapping, sexual abuse and assault- were overturned. State v. Van (2004)
Van and the victim JGC agreed to enter a master/slave relationship with "no limits". The nature and context of the relationship between JGC and Van were outlined in emails exchanged between the two men. The beginning of the physical aspect of this relationship began with JGC staging his own abduction and making contact with another male submissive of Van's. After a day or so in service to Van, JGC was instructed to write down everything he had done wrong in his life. JGC testified before a jury of his peers that the activity was "cathartic" and made him want to return to his home in Texas. In the email exchange, Van denied JGC's plea to return home and stated that JGC was to be kept there by Van, despite protest. After a length of time, the other submissive assisted JGC in escaping and returning home. Once there, a police report was filed. Van was convicted of sexual assault in the first degree, assault in the first degree, assault in the second degree, first degree false imprisonment, and terrorist threats. State v. Gaspar (2009)
Litigation in the courts to determine the line between consensual sexual activity and sexual assault with excessive force. In 2003, a woman using an online chat room met the defendant Gaspar. They began to engage in a casual sexual relationship. However, the testimonies of the victim and the defendant differ as to the events leading up to the night of 8 November 2003. Gaspar claims that he and the victim had discussed her sadomasochistic activities while traveling. She claims there was no such conversation. The defendant claims that the two conversed online and in person about her interests in the activity, and then during a meeting in the victim's apartment, the events in question took place. Gaspar testified to a consensual encounter, where the victim describes a sexual assault. The victim then contacted authorities and complied with their investigations. The victim received medical attention at the local Women and Children's Hospital, where the nurse equated her injures to that of child birth. Due to improper permitted testimony, the decision of the lower court was overturned and the charges of five accounts of sexual assault were dropped. Other related cases 
 One, Inc. v. Olesen (1958)

Decided that the distribution of homosexual publications and content through the US Postal Service is not illegal on the grounds of obscenity. Lawrence v. Texas (2003)

The Supreme Court of the United States Declares anti-sodomy laws unconstitutional. This was influential in further cases defining consensual sexual activity in the eyes of the law. In March 2016, the case of Doe v. George Mason University, the Federal District court of east Virginia ruled that there is no constitutional right to engage in consensual BDSM sexual activity. Ballot Measures 
Oregon Ballot Measure 9 was a ballot measure in the U.S. state of Oregon in 1992, concerning sadism, masochism, gay rights, pedophilia, and public education, that drew widespread national attention. It would have added the following text to the Oregon Constitution:

It was defeated in 3 November 1992 general election with 638,527 votes in favor, 828,290 votes against. The National Coalition for Sexual Freedom collects reports about punishment for sexual activities engaged in by consenting adults, and about its use in child custody cases. See also
List of universities with BDSM clubs
LGBT rights by country or territory
Pornography laws by region
Sex and the law
Sex toy - Legal issues
Section 63 of the Criminal Justice and Immigration Act 2008
Operation Spanner
Rough sex murder defense

References

BDSM
Sex and the law