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 José Arcadio kills Prudencio Aguilar after a cockfight for suggesting José Arcadio was impotent. One night of their emigration journey, while camping on a riverbank, José Arcadio 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, his 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 man named Melquíades, maintains a close friendship with José Arcadio, 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 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 tires of war and signs a peace treaty with the Conservatives. Disillusioned, he returns to Macondo and spends the rest of his life making tiny gold fish in his workshop.
The railroad comes to Macondo, bringing in new technology and many foreign settlers. An American fruit company establishes a banana plantation outside the town, and builds its own segregated village across the river. This ushers in a period of prosperity that ends in tragedy as the Colombian army massacres thousands of striking plantation workers, an incident based on the 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 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, whose parentage is hidden by his grandmother Fernanda, and he and Amaranta Úrsula unknowingly begin an incestuous relationship. 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 as the last member of the family. He decodes an encryption Melquíades had left behind in a manuscript generations ago. The secret message informs the recipient of every fortune and misfortune that the Buendía family's generations lived through. As Aureliano reads the manuscript, he feels a windstorm starting around him, and he reads in the document that the Buendía family is doomed to be wiped from the face of the Earth because of it. In the last sentence of the book, the narrator describes Aureliano reading this last line just as the entire town of Macondo is scoured from existence.