One Hundred Years of Solitude is the story of seven generations of the Buendía Family in the town of Macondo. The founding patriarch of Macondo, José Arcadio Buendía, and Úrsula Iguarán, his wife (and first cousin), leave Riohacha, Colombia, after Arcadio kills Prudencio Aguilar after a cockfight, for suggesting Arcadio was impotent. One night of their emigration journey, while camping on a riverbank, José Arcadio Buendía dreams of "Macondo", a city of mirrors that reflected the world in and about it. Upon awakening, he decides to establish Macondo at the riverside; after days of wandering the jungle, José Arcadio Buendía's founding of Macondo is utopic.
José Arcadio Buendía believes Macondo to be surrounded by water, and from that island, he invents the world according to his perceptions. Soon after its foundation, Macondo becomes a town frequented by unusual and extraordinary events that involve the generations of the Buendía family, who are unable or unwilling to escape their periodic (mostly self-inflicted) misfortunes. For years the town is solitary and unconnected to the outside world with the exception of the annual visit of a band of gypsies, who show the townspeople technology such as magnets, telescopes and ice. The leader of the gypsies, a rough man named Melquiades, maintains a close friendship with José Arcadio Buendía who becomes increasingly withdrawn, obsessed with investigating the mysteries of the universe presented to him by the gypsies. Ultimately he is driven insane, speaking only in Latin, and is tied to a chestnut tree by his family for many years until his death.
Eventually Macondo becomes exposed to the outside world and the government of newly-independent Colombia. A rigged election between the Conservative and Liberal parties is held in the town, inspiring Aureliano Buendía to join a civil war against the Conservative government. He becomes an iconic revolutionary leader, fighting for many years and surviving multiple attempts on his life, but ultimately becomes tired of war and signs a peace treaty with the Conservatives. Disillusioned, he returns to Macondo and spends the rest of his life making tiny goldfish out of gold in his workshop.
The railroad comes to Macondo, bringing in new technology and many foreign settlers. An American fruit company constructs a banana plantation outside the town and builds their own segregated village across the river. This ushers in a period of prosperity that ends in tragedy as thousands of striking plantation workers are massacred by the Colombian army, an incident based on the real life Banana Massacre of 1928. José Arcadio Segundo, the only survivor of the massacre, finds no evidence of the massacre and the surviving townspeople refuse to believe that it happened.
By the novel's end, Macondo has fallen into a decrepit and near-abandoned state, with the only remaining Buendías being Amaranta Úrsula and her nephew Aureliano. Aureliano's parentage is hidden by his grandmother Fernanda, and he and Amaranta Úrsula enter an incestuous relationship unknowingly. They have a child who bears the tail of a pig, fulfilling the lifelong fear of the long-dead matriarch Úrsula. Amaranta Úrsula dies in childbirth and the child is devoured by ants, leaving Aureliano the last member of the family. He decodes an encryption left behind in a manuscript by Melquiades generations ago. The secret message informs the recipient of every fortune and misfortune lived by the Buendía family's generations. As he reads the manuscript, a hurricane destroys all traces of Macondo's existence.