José Arcadio Buendía and his wife, Úrsula Iguarán, set out from Riohacha, Colombia to make a new home for themselves. While sleeping on a riverbank, José Arcadio Buendía dreams of the town of Macondo, a city made of mirrors, and he determines that the place where they sleep is where they should establish the town.
José Arcadio Buendía oversees the building of the village as his family grows—his sons José Arcadio (I) and Aureliano (later known as Colonel Aureliano Buendía) are born on the way to or in Macondo. A band of gypsies visits periodically to show the residents inventions like magnifying glasses, magnets, and flying carpets. The gypsy Melquíades leads this band, and he shares a prophecy written in code with José Arcadio Buendía, prompting him to become obsessed with technology, specifically alchemy.
The book flashes back to before José Arcadio Buendía and Úrsula Iguarán left Riohacha. They were warned that, because they are first cousins, their children could have genetic defects (two of their ancestors gave birth to a child with a pig’s tail). Since they’re reluctant to consummate their marriage, rumors swirl that José Arcadio Buendía is impotent, and he kills a man—Prudencio Aguilar—for mocking him.
Back in the present, the gypsies come to show José Arcadio Buendía a block of ice, which fascinates him. His older son, José Arcadio (now a teenager), is seduced by Pilar Ternera, a fortune teller whom he impregnates. However, he leaves town with the gypsies. Just after, Úrsula gives birth to her daughter, Amaranta, and leaves home to try to find her son, discovering a shortcut between Macondo and civilization in the process.
Pilar Ternera gives birth to José Arcadio’s son Arcadio and the Buendía family adopts an orphan named Rebeca who suffers from contagious insomnia that causes memory loss, a condition which grows to infect the whole town. Melquíades arrives with a cure for the amnesia: the photograph. José Arcadio Buendía tries to use the technology to take a photo of God, but he is unable to, and his son Aureliano tries to learn the silversmith trade from Melquíades. A representative of the central government, Don Apolinar Moscote, appears in the formerly-independent Macondo and José Arcadio Buendía challenges him, stripping him of much of his authority. Despite the Moscotes being enemies of the Buendía family, Aureliano falls in love with the youngest Moscote daughter, Remedios.
Waiting for his betrothed to come of age, Aureliano, too, sleeps with Pilar Ternera. Meanwhile, the Buendía daughters, Amaranta and Rebeca, fall in love with Pietro Crespi, the Italian pianola expert hired to give them dancing lessons. Crespi chooses Rebeca, and Amaranta vows to prevent their marriage. After Melquíades dies of old age, José Arcadio Buendía’s obsessions with the mysteries of the world drive him to madness. Convinced that each day is the same as the one before, he is tied to a tree in the yard.
Remedios and Aureliano marry, but Amaranta sabotages the wedding of Pietro Crespi and Rebeca, which was to happen on the same day. Remedios dies soon after the wedding, pregnant with twins. When the eldest son, José Arcadio (who ran away with the gypsies), returns, Rebeca cannot resist her attraction to her adopted brother and they marry. Úrsula banishes the couple from the house. Aureliano takes an interest in the Liberal side of the war with the Conservatives, leading a rebellion in town before leaving to fight elsewhere. From this point on, he is known as Colonel Aureliano Buendía.
Arcadio is in charge of the town after the victory of the Liberal party, but he quickly becomes a dictator himself. Attracted to Pilar Ternera, he tries to sleep with her, but she knows he is her son, and so she pays Santa Sofía de la Piedad to go in her place. Arcadio marries her and she gives birth to their daughter Remedios the Beauty. When the Liberals lose the war, Arcadio is executed by firing squad. Pietro Crespi proposes to Amaranta but, despite her love for him, she declines. He commits suicide and she burns her hand to punish herself, wearing a black bandage over the burn for the rest of her life.
Colonel Aureliano Buendía and Colonel Gerineldo Márquez are sentenced to be executed by firing squad. José Arcadio prevents the execution at the last minute, and Colonel Aureliano Buendía returns to war. Eventually, he is deserted by the official Liberal party for his radical actions, and he realizes he is fighting not for his ideals, but out of pride, so he leaves the army. Santa Sofía de la Piedad gives birth to the twin sons of her dead husband, naming them José Arcadio Segundo and Aureliano Segundo. Perhaps because of his recent brave actions saving his brother, José Arcadio is murdered, and his widow Rebeca becomes a hermit. Colonel Gerineldo Márquez is left to govern the town and pursues romance with Amaranta, but she spurns him, too. Finally, José Arcadio Buendía, the patriarch tied to a tree, dies, and the sky rains yellow flowers.
Aureliano José, the son of José Arcadio and Pilar Ternera, grows up and finds himself attracted to his aunt Amaranta. They sleep naked together, but never consummate their feelings. When she insists they stop sleeping together, he joins the army just before a peace treaty is signed. Aureliano José deserts the army to tell Amaranta he wants to be with her, but he is killed by a Conservative soldier as he returns home.
Colonel Aureliano Buendía’s seventeen sons arrive to Macondo to meet him just before he returns to fight in an attempt to convince the Liberals to end the useless war once and for all. He agrees to sign a treaty that he believes betrays both himself and his party and then attempts to kill himself.
Having survived his suicide attempt, Colonel Aureliano Buendía secludes himself in his workshop making fish out of gold. Both of the twin brothers sleep with the same woman, Petra Cotes, though Aureliano Segundo’s relationship with her proves to be long-lasting and has a magical effect on their livestock, making them incredibly fertile. José Arcadio succeeds in bringing a boat down the river to Macondo, celebrating with a carnival. Remedios the Beauty is named queen of the carnival but her position is challenged by another queen, Fernanda del Carpio, and a riot breaks out, killing many in the crowd.
The story flashes back to reveal more about Fernanda del Carpio’s upbringing in a declining aristocratic home that gave her unrealistic expectations for her life. After the carnival, Aureliano Segundo marries her, though their temperaments are not well-matched, and Aureliano Segundo continues his affair with Petra Cotes. Fernanda del Carpio and Aureliano Segundo have two children: Meme and José Arcadio (II). The seventeen Aurelianos return to celebrate the anniversary of the armistice, receiving a permanent mark of ashes on their foreheads for Ash Wednesday. Aureliano Triste and Aureliano Centeno decide to remain in Macondo to build the ice factory their grandfather had dreamed of and a railroad connecting Macondo to the outside world.
The arrival of the train brings with it other modern technologies and foreign investors in a banana plantation across the river. Remedios the Beauty remains ignorant of all that is changing in the village and of the deadly effect her beauty has on men. One day she ascends into heaven, never to be seen again. Colonel Aureliano Buendía, dismayed by the changes to the city, threatens to start a war to return Macondo to its original state. He plans to use his seventeen sons as his army, but assassins kill all of his sons but one.
Úrsula is going blind, but she is able to keep it a secret because she is so well acquainted with people’s habits. José Arcadio and Meme go away to school, allowing Aureliano Segundo the freedom to move in with Petra Cotes. Colonel Aureliano Buendía dies.
Fernanda del Carpio gives birth to her third child, Amaranta Úrsula. The elder Amaranta sews her funeral shroud and dies on the day it is finished. Úrsula, grieving the last of her children, goes to bed and doesn’t move for many years.
Meme falls in love with a mechanic named Mauricio Babilonia, who is trailed constantly by yellow butterflies. Fernanda del Carpio forbids Meme from seeing Babilonia, but he sneaks in each night to make love to her. Fernanda del Carpio hires a guard who shoots Mauricio Babilonia the next time he tries to visit, paralyzing him, and sends Meme away to a convent. Several months later, a nun arrives to the Buendía house to deliver the child Meme gave birth to, Aureliano. Fernanda, ashamed of the illegitimate child, pretends he is an unrelated orphan and hides him.
José Arcadio Segundo organizes the banana plantation workers to strike for better conditions. At a meeting to resolve their issues, an army kills 3000 of the workers leaving only José Arcadio Segundo alive. Their bodies are loaded on a train and dumped in the ocean, but no one in town believes this story. Rain begins to fall. José Arcadio Segundo hides in Melquíades’ old room and trying to decipher the manuscripts.
The rain continues for nearly five years. Aureliano Segundo, trapped in his house, begins to care for Amaranta Úrsula and little Aureliano. All of the livestock die in the flood. Fernanda seeks treatment for a uterine disease by writing letters to “Imaginary Doctors.” Aureliano Segundo believes he can find the fortune of gold coins Úrsula has hidden somewhere in or around the house, digging up the land in search. The rain ends, revealing a decimated Macondo.
Úrsula finally emerges from bed and then dies at the age of 120, closely followed by the forgotten Rebeca. Aureliano Segundo begins to rapidly lose weight and hurries to earn the money needed to send Amaranta Úrsula to school in Brussels. José Arcadio Segundo shows his grandnephew Aureliano the progress he has made in deciphering Melquíades’ manuscript, so that he might take up with the project after him. Aureliano Segundo and José Arcadio Segundo, having completed the tasks they aimed to, die at the same moment and their bodies are buried in each other’s graves.
Aureliano determines that Melquíade’s prophecies are written in Sanskrit and that they will be deciphered when they are one hundred years old. Santa Sofia de la Piedad, all but forgotten, walks away from the house without another word and, soon after, Fernanda del Carpio dies. José Arcadio returns and finds the gold Úrsula had hidden under her bed, squandering it on parties with the youth of the town, who eventually drown him and steal his gold.
Amaranta Úrsula returns from Brussels with her husband Gaston on a leash. Aureliano pines after Amaranta Úrsula, but he tries to distract himself by befriending an old Catalonian bookseller and some young men who meet to talk about their studies at the shop. At a brothel, Aureliano meets the ancient Pilar Ternera who gives him advice. Aureliano admits his love to Amaranta Úrsula and they become lovers while Gaston is on a business trip—Amaranta Úrsula tells him never to return.
The Catalonian bookseller and Aureliano’s friends all leave Macondo. The Buendía house has been destroyed by a swarm of red ants. Aureliano and Amaranta Úrsula bear a child (which they name Aureliano) who, in line with Úrsula’s fears all those years ago, is born with the tail of pig. Amaranta Úrsula dies soon after giving birth. Aureliano, in his grief, forgets about the baby and finds it being devoured by ants. He finally deciphers Melquíades’ prophecies, a history of the Buendía family. As he reads, a hurricane destroys Macondo.