Onan
Onan is the second of the three sons born to Judah by Shua's daughter the Canaanitess. He appears at his birth in Genesis 38, dies under Yahweh's hand in the same chapter for refusing to raise up seed to his deceased older brother, and is thereafter remembered in the Pentateuch and the Chronicler as one of the two Judahite sons who died in Canaan before the descent into Egypt.
Birth and Naming
Onan enters the narrative inside the Judah-and-Tamar chapter, in the brief account of Judah's marriage to a Canaanite woman: "And Judah saw there a daughter of a certain Canaanite whose name was Shua. And he took her, and entered her" (Gen 38:2). The first son, Er, is named by Judah; the second is named by the mother: "And she became pregnant again, and gave birth to a son; and she named him Onan" (Gen 38:4). The third, Shelah, follows in turn (Gen 38:5). The naming-by-the-mother places Onan distinctly between the father-named firstborn and the geographically-tagged third son.
Refusal of Levirate Duty and Death
After Er marries Tamar, "Er, Judah's firstborn, was wicked in the sight of Yahweh. And [the Speech of] Yahweh slew him" (Gen 38:7). Judah then directs the levirate obligation to Onan: "Enter your brother's wife, and perform the duty of a husband's brother to her, and raise up seed to your brother" (Gen 38:8). Onan complies in form but refuses the function: "And Onan knew that the seed would not be his; and it came to pass, whenever he entered his brother's wife, that he spilled on the ground, lest he should give seed to his brother" (Gen 38:9). The refusal is fatal: "And the thing which he did was evil in the sight of Yahweh: and [by his Speech] he slew him also" (Gen 38:10). The bracketed Speech-resolutions in verses 7 and 10 align Onan's death with Er's under the same agent — both brothers fall in Canaan in the sight of Yahweh, and the chapter sets up Tamar's later resort to Judah himself by sealing off the second levirate channel.
Remembered Among Judah's Sons Who Died in Canaan
Outside Genesis 38, Onan does not act in his own right within the surveyed witness — he is a name on a roll, paired with Er and tagged as a Canaan-death across the genealogical and census notices.
In the Egypt-descent list, the Judah-branch entry runs: "And the sons of Judah: Er, and Onan, and Shelah, and Perez, and Zerah; but Er and Onan died in the land of Canaan. And the sons of Perez were Hezron and Hamul" (Gen 46:12). The five-name son-tag puts Onan in the second slot, and the adversative clause prunes him and Er off the household count crossing into Egypt; Perez and Zerah, born to Tamar, fill the gap left by the two Canaan-deaths.
The same prune is repeated in the second-census entry on the plains of Moab: "The sons of Judah: Er and Onan; and Er and Onan died in the land of Canaan" (Nu 26:19). The roll names just the two who do not enter the counted families, and the verb-clause re-locates their deaths in Canaan, closing them out of the families enrolled for the inheritance allotment.
The Chronicler compresses the Judah-branch genealogy still further: "The sons of Judah: Er, and Onan, and Shelah; which three were born to him of Shua's daughter the Canaanitess. And Er, Judah's firstborn, was wicked in the sight of Yahweh; and he slew him" (1Ch 2:3). Onan keeps the second slot between the slain firstborn Er and the surviving Shelah, and the relative clause tying all three to "Shua's daughter the Canaanitess" preserves the Genesis 38 origin. The Chronicler singles out Er's wickedness for explicit comment but lets Onan's death stand without separate notice — the Genesis 38 account is presupposed rather than retold.