William of Baskerville and his apprentice Adso of Melk (narrating as an old man, it later transpires) arrive at a Benedictine abbey where a mysterious death has occurred ahead of an important Church conference. William, known for his deductive and analytic mind, confronts the worried Abbot and gains permission to investigate the death a young illuminator appears to have committed suicide. Over the next few days, several other bizarre deaths occur, and the two discover that not everything is what it seems in the abbey.
The two also make the acquaintance of Salvatore, a demented hunchback who spews forth gibberish in various languages, and his handler and protector, Remigio da Varagine who, as events prove, also has a shady past. William quickly deduces that Salvatore had once been a member of a heretical sect and infers that Remigio likewise had been involved. He suspects that they may have been involved in the killings.
Investigating and keen to head off accusations of demonic possession, the protagonists discover and explore a labyrinthine medieval library, constructed on multiple levels in the abbey's forbidden principal tower. William deduces, thanks to a scrap of parchment with hastily written notes, that all of those who died under mysterious circumstances had read the book. His investigations are curtailed by the arrival of Bernardo Gui of the Inquisition, summoned for the conference and keen to investigate the deaths. The two men clashed in the past and the zealous inquisitor has no time for theories outside his own: that the devil is responsible and torture will reveal the truth.
To their great misfortune, Salvatore and a local girl are found fighting over meat while in the presence of candles and a black cat. Bernardo Gui sees this as irrefutable proof that they are in league with Satan and, along with Remigio, he has them manacled and subjected to "questioning". Grisly scenes ensue showing Salvatore being branded and his arms and hands mangled by the inquisitors. He is then dragged into a kangaroo court tribunal and unsuccessfully prompted by Gui to implicate his partner and the girl who is lying unconscious on the floor.
It is possible that Salvatore has been driven insane as a result of Gui's torture, prompting Remigio to later scream, "The devil I renounce is you, Bernardo Gui!" At first Remigio shows nothing but contempt for his tormentors and brags about spending most of his life shaking down the poor in the name of the Church and its corrupt officials. But then Gui threatens to show Remigio the torture instruments, and then Remigio begins to wildly confess to every insane suggestion that Gui throws his way. It is soon clear that Gui also seeks to implicate and kill Brother William.
Ascending the forbidden library, William and Adso come face to face with the Venerable Jorge, the most ancient denizen of the abbey, who reveals the book, which contains a description of comedy and how it may be used to teach. Being afraid of laughter and comedy the traditionalist firmly asserts that Christ never laughed and jocularity is a blasphemous, Jorge has poisoned the pages to avoid the spread of what he considers dangerous ideas.
Realizing that William knows of the poisoned pages and will not fall for the same trick, Jorge throws over a candle, starting a blaze that spreads quickly in the tower, the internal structure of which is completely made of wood. As it contains innumerable rare and unique books of infinite value, this devastates William, who insists Adso flee while he desperately tries to save as many tomes as possible. The fire kills Jorge and destroys the Second Book of the Poetics, but miraculously, William does make it out with a few precious books. Facing a local rebellion due to his harsh methods, Bernardo Gui is fortunately denied his revenge on William and forced to flee but dies horribly when the enraged peasants' mob throws his wagon down a cliff, resulting in his own impalement on one of his hellish inquisitorial torture devices. Later, William and Adso take their leave the latter having lost his heart and virginity to the girl whom he nevertheless turns his back on in favour of remaining with William and his calling. A much older Adso reflects in his closing narration that he never regretted his decision and that the girl was the only Earthly love of his life, yet he never learned her name.