Joanna was born in the city of Toledo, the capital of the Kingdom of Castile. She was the third child and second daughter of Isabella I of Castile and Ferdinand II of Aragon of the royal House of Trastámara. She was trained and educated for a significant marriage that, as a royal family alliance, would extend the kingdoms' power and security as well as its influence and peaceful relations with other ruling powers. As an infanta she was not expected to be heiress to the throne of either Castile or Aragon, although through deaths she later inherited both.
In 1496, Joanna, at the age of sixteen, was betrothed to Philip the Handsome, Duke of Burgundy, in the region of Flanders in the Low Countries. The marriage was one of a set of family alliances between the Habsburgs and the Trastámaras designed to strengthen both against growing French power. Joanna's life with Philip was rendered extremely unhappy by his infidelity and her political insecurity. He consistently attempted to usurp her legal birthrights to power. This led in no small part to rumors of her insanity, stoked by reports of her depressive or neurotic acts while she was imprisoned or manipulated by her husband.
The death of Joanna's brother John, the stillbirth of John's daughter and the deaths of Joanna's older sister Isabella and Isabella's son Miguel made Joanna heiress to the Spanish kingdoms. In 1502, the Castilian Cortes of Toro recognized Joanna as heiress to the Castilian throne and Philip as her consort. Upon the death of her mother in November 1504, Joanna became Queen regnant of Castile. Joanna's father, Ferdinand II, lost his monarchical status in Castile although his wife's will permitted him to govern in Joanna's absence or, if Joanna was unwilling to rule herself, until Joanna's heir reached the age of 20. Ferdinand refused to accept this: he persuaded the Cortes that Joanna's "illness is such that the said Queen Doña Joanna our Lady cannot govern". The Cortes then appointed Ferdinand as Joanna's guardian and the kingdom's administrator and governor. In 1506 Philip and Ferdinand signed a treaty, agreeing that Joanna's mental instability made her incapable of ruling and promising to exclude her from government.
On 25 September 1506 Philip died suddenly of typhoid fever in the city of Burgos in Castile. Some suspected that he had been poisoned by his father-in-law Ferdinand II who had always disliked his foreign Habsburg origins and with whom he never wanted to share power. Ferdinand then constrained Joanna to yield up her power over the Kingdom of Castile and León to himself. He had Joanna confined in the Santa Clara convent in Tordesillas, near Valladolid in Castile, in February 1509 after having dismissed all of her faithful servants and having appointed a small retinue accountable to him alone. At this time, some accounts claim that she was insane or "mad", and that she took her husband's corpse with her to Tordesillas to keep it close to her.
In 1517 her own son, Charles I, ensured his domination and throne by having his mother confined for the rest of her life in the rooms of the Convent of Santa Clara in Tordesillas, Castile. Joanna's condition degenerated further. She apparently became convinced that some of the nuns of the convent wanted to kill her, a fear which was never proved. Reportedly it was difficult for her to eat, sleep, bathe, or change her clothes. Charles wrote to the Convent of Santa Clara caretakers: "It seems to me that the best and most suitable thing for you to do is to make sure that no person speaks with Her Majesty, for no good could come from it".
Joanna died on Good Friday, 12 April 1555 at the age of 75 in the Convent of Santa Clara at Tordesillas.