Onan

Onan was a figure detailed in the Book of Genesis chapter 38, as the second son of Judah who married the daughter of Shuah the Canaanite. Onan had an older brother Er and a younger brother, Shelah as well.

After being commanded by his father, Judah, to perform his duty as a husband's brother according to the custom of levirate marriage with the late Er's wife Tamar, Onan instead refused to perform his duty as a levirate and "spilled his seed on the ground whenever he went in" because "the offspring would not be his", and was thus put to death by Yahweh. This act is detailed as retribution for being "displeasing in the sight of Lord". Onan's crime is often misinterpreted to be masturbation but it is universally agreed among biblical scholars that Onan's death is attributed to his refusal to fulfill his obligation of levirate marriage with Tamar by committing coitus interruptus.

Biblical account
After Yahweh slew Onan's oldest brother Er, Onan's father Judah told him to fulfill his duty as a brother-in-law to his brother Er by entering into a levirate marriage     with his brother's widow Tamar to give her offspring. Religion professor Tikva Frymer-Kensky has pointed out the economic repercussions of a levirate marriage: any son born to Tamar would be deemed the heir of the deceased Er and could claim the firstborn's double share of an inheritance. However, if Er were childless or only had daughters, Onan would have inherited as the oldest surviving son.

When Onan had sex with Tamar, he withdrew before he ejaculated and "spilled his seed on the ground" thus committing coitus interuptus, since any child born would not legally be considered his heir. The next statement in the Bible says that Onan displeased Yahweh, so the Lord slew him. Onan's crime is often misinterpreted to be masturbation but it is universally agreed among biblical scholars that Onan's death is attributed to his refusal to fulfill his obligation of levirate marriage with Tamar by committing coitus interruptus.

However, Onan‘s reluctance to give a child to his sister-in-law may reflect a rejection of this custom already present in society. The regulation of levirate marriage in Deut 25:5–10 shows that the custom had encountered some opposition. The law in Deuteronomy allowing a man to refuse his duty was a concession to the reluctance to comply with the custom. Because of Onan's unwillingness to bear a child for his deceased brother, Yahweh was displeased with Onan and slew him also (Gen 38:10).

Interpretation
The implication from the narrative is that Onan's act as described is what gave rise to divine displeasure.

Early Jewish views
One opinion expressed in the Talmud argues that this was where the death penalty's imposition originated. Talmud also likens emitting semen in vain to shedding blood.

However, the regulations concerning ejaculation in the book of Leviticus, whether as a result of sexual intercourse or not, merely prescribe a ritual washing and becoming ritually impure until the following evening.

Classical Christian views
Early Christian writers have sometimes focused on the spilling seed, and the sexual act being used for non-procreational purposes. This interpretation was held by several early Christian apologists. Jerome, for example, argued:

"But I wonder why he the heretic Jovinianus set Judah and Tamar before us for an example, unless perchance even harlots give him pleasure; or Onan, who was slain because he begrudged his brother his seed. Does he imagine that we approve of any sexual intercourse except for the procreation of children?"

Epiphanius of Salamis wrote against heretics who used coitus interruptus, calling it the sin of Οnan:

"They soil their bodies, minds and souls with unchastity. Some of them masquerade as monastics, and their woman companions as female monastics. And they are physically corrupted because they satisfy their appetite but, to put it politely, by the act of Onan the son of Judah. For as Onan coupled with Tamar and satisfied his appetite but did not complete the act by planting his seed for the God-given [purpose of] procreation and did himself harm instead, thus, as [he] did the vile thing, so these people have used their supposed [female monastics], committing this infamy. For purity is not their concern, but a hypocritical purity in name. Their concern is limited to ensuring that the woman the seeming [ascetic] has seduced does not get pregnant—either so as not to cause child-bearing, or to escape detection, since they want to be honored for their supposed celibacy. In any case, this is what they do, but others endeavor to get this same filthy satisfaction not with women but by other means, and pollute themselves with their own hands. They too imitate the son of Judah, soil the ground with their forbidden practices and drops of filthy fluid and rub their emissions into the earth with their feet"

Clement of Alexandria, while not making explicit reference to Onan, similarly reflects an early Christian view of the abhorrence of spilling seed:

"Because of its divine institution for the propagation of man, the seed is not to be vainly ejaculated, nor is it to be damaged, nor is it to be wasted."

"To have coitus other than to procreate children is to do injury to nature."

Roman Catholic views
The papal encyclical Casti connubii (1930) invokes this Biblical text in support of the teaching of the Catholic Church against contracepted sex by quoting St. Augustine, "Intercourse even with one's legitimate wife is unlawful and wicked where the conception of the offspring is prevented. Onan, the son of Juda [sic], did this and the Lord killed him for it."

Early Protestant views
Making reference to Onan's offense to identify masturbation as sinful, in his Commentary on Genesis, John Calvin wrote that "the voluntary spilling of semen outside of intercourse between a man and a woman is a monstrous thing. Deliberately to withdraw from coitus in order that semen may fall on the ground is double monstrous."

Methodism founder John Wesley, according to Bryan C. Hodge, "believed that any waste of the semen in an unproductive sexual act, whether that should be in the form of masturbation or coitus interruptus, as in the case of Onan, destroyed the souls of the individuals who practice it". He wrote his Thoughts on the Sin of Onan (1767), which was reproduced as A Word to Whom it May Concern on 1779, as an attempt to censor a work by Samuel-Auguste Tissot. In that writing, Wesley warned about "the dangers of self pollution", the bad physical and mental effects of masturbation, writes many such cases along with the treatment recommendations.

Disputes
According to some Bible critics who contextually read this passage, the description of Onan is an origin myth concerning fluctuations in the constituency of the tribe of Judah, with the death of Onan reflecting the dying out of a clan; Er and Onan are hence viewed as each being representative of a clan, with Onan possibly representing an Edomite clan named Onam, mentioned by an Edomite genealogy in Genesis.

Biblical scholars universally agree that the biblical story of Onan is not about masturbation nor about contraception per se or the "wasting of semen" but his refusal to fulfill his obligation of levirate-marriage with Tamar by committing coitus interruptus.

The text emphasizes the social and legal situation, with Judah explaining what Onan must do and why. A plain reading of the text is that Onan was killed because he refused to follow instructions. Scholars have argued that the secondary purpose of the narrative about Onan and Tamar, of which the description of Onan is a part, was to either assert the institution of levirate marriage or present a myth for its origin; Onan's role in the narrative is, thus, as the brother abusing his obligations by agreeing to sexual intercourse with his dead brother's wife, but refusing to allow her to become pregnant as a result. Emerton regards the evidence for this to be inconclusive, although classical rabbinical writers argued that this narrative describes the origin of levirate marriage.

John M. Riddle argues that "Epiphanius (fourth century) construed the sin of Onan as coitus interruptus". John T. Noonan Jr. says that "St. Epiphanius gave a plain interpretation of the text as a condemnation of contraception, and he did so only in the context of his anti-Gnostic polemic".

Bible scholars maintained that the story does not refer to masturbation, but to coitus interruptus. Bible scholars even maintain that the Bible does not claim that masturbation would be sinful. 

Although the story of Onan does not involve masturbation, according to Peter Lewis Allen, some theologians found "a common element" in both coitus interruptus (also known as onanism) and masturbation, as well as anal intercourse and other forms of nonmarital and nonvaginal sexual acts, which are considered wrongful acts.

Onanism
The term onanism has come to refer to "masturbation" in many modern languages – for example Hebrew (אוננות, onanút), German (Onanie), Greek (αυνανισμός, avnanismós), Japanese (オナニー, onanī), and Swedish (onani) – based on an interpretation of the Onan story.

The word onanism is not based on the biblical story of Onan itself but on an interpretation of that biblical story, nor is the word onanism found in any form in the biblical texts. Thus the etymological connection of onanism (in the sense of masturbation) with Onan's name is misleading.

The Merriam-Webster online dictionary defines onanism as:
 * 1) masturbation
 * 2) coitus interruptus
 * 3) self-gratification