The story is told in a frame formatTwain meets a stranger while touring Warwick Castle, England, who presents him with a manuscript of his memoirs. The stranger is Hank Morgan, a Connecticut factory superintendent and self declared "Yankee of the Yankees" who fights with one of his men, Hercules, and is knocked out when he is hit in the head with a crowbar. He awakes to find himself in a bucolic landscape being charged by a knight in armor. Hank is taken prisoner by Sir Kay, the seneschal of Arthur's court and brought to Camelot. Thinking that he has landed in an asylum , Hank goes along with his captor, determined to escape or "run the show." He enters Arthur's court and meets a garrulous paige named Clarence who immediately befriends him and tells him that it is the year 528. Hank decides to test if this statement is true by waiting for a solar eclipse that is supposed to occur on the 21st of June, two days away. When he is presented as Kay's prisoner, he is described as a horrible ogre and sentenced to die.
Hank concocts the lie that he is a great and terrible magician, and will blot out the sun if he is not released. When Clarence reports his lie to the King, they decide to execute him a day earlier than they had planned. When Hank is taken to the stake he thinks that it is only the twentieth and that his bluff has backfired. But when the sun begins to blacken under the shadow of the eclipse, he jumps on the opportunity and majestically claims that he is responsible for the calamity. The crowd and court panic, agreeing to make Hank the king's executor in exchange for the sun.
Hank immediately uses his new position of power to institute modern conveniences and structures that he was accustomed to in Connecticut and to bring 19th c. civilization to 6th c. England. He sets up clandestine schools, factories and works hidden from the eyes of the Church, which he fears above everything else. Hank also undermines Merlin's influence on the people by exploding his tower and relegating him to obscurity. Hank takes on the title, The Boss, signifying his role as person who will run the country and direct it into modernity.
As Hank reviews a tournament, he mutters an insult at the court clown that is heard by another of Arthur's knights. Sir Sagramore challenges Hank to armed combat to occur after he has quested for the Holy Grail for about four years. During this time, Hank carefully incubates his civilization. Towards the end of the period, Arthur sends the Yankee on a quest of adventures to gain merit and honor before meeting Sir Sagramore in combat. To do this, Hank is assigned a damsel named Alisande (whom he calls Sandy) to help her rescue some forty maidens from a castle ruled by ogres. Having no choice but to ride with her, he dons armor and sets off from Camelot.
The task of wearing the armor proves to be almost impossible as he spends hot days and cold nights encased in the heavy hardware. He needs to be lifted onto his horse and despairs at not having pockets.
The pair encounter adventures of a comic sort, such as vanquishing challenger knights with the smoke from Hanks pipe, to meeting up with Hank's "missionary knights" who peddle soap, stove polish and toothbrushes around the country.
Along the way, they also see many pitiable episodes of abuse and injustice, and Hank sets a dungeon full of prisoners free when he encounters them in Morgan Le Fay's castle. Finally Hank and Sandy reach the object of their taskthe ogre's castle. It is no more than a pigsty, and its captives hogs.
After 'liberating the castle,' Hank sets off for the Valley of Holiness to restore a fountain that has suddenly stopped flowing. He telephones Camelot and tells Clarence (his now trusty sidekick) to send him chemicals and supplies to perform the "miracle." Hank knows that Merlin is already in the Valley making a magical attempt to restore the waters, and Hank plays up the opportunity to embarrass Merlin while elevating his status with the people. When he successfully restores the fountaina mere leaky wellwith fireworks and drama, he is an instant hero.
Hank next decides to leave the talkative Sandy in the Valley while he travels through the countryside incognito to see how the people live. King Arthur thinks it is a splendid idea and decides to go too. The pair fall into all sorts of mishaps since Arthur knows nothing about being a humble peasant and shows it. Hank constantly has to look out for him and even throws a bomb at two knights who charged at the disguised king.
In their travels, the King and his Minister meet with a downtrodden and oppressed people. Day after day they see heartbreaking scenes of death and injustice. The King proves to be a noble hearted man with genuine compassion for his subjects; in the book's most melodramatic scene, he braves exposure to smallpox to carry a dying girl to her mother. During this time, Hank grows to respect Arthur for his character, even though philosophically, he detests the idea of monarchy.
After a fight with some townsmen, Hank and Arthur are taken by an earl and sold into slavery against their will. During a month of horrible subjugation and suffering, Hank and Arthur travel from town to town as the lowest subjects in the kingdom. Arthur declares that he will abolish slavery as soon as he returns to his position, and a heartened Hank sets his mind to work for their escape.
The chain-gang arrives in London and Hank spots a telegraph wire of one of his subordinates on a rooftop. He gets the idea of beating their master after everyone has gone to sleep and escaping into London to contact Camelot. His plan backfires however, when he is unable to free Arthur and must flee alone. Instead of beating his owner, Hank accidentally fights with a peasant in the dark and lands in jail for the night. The next morning, he hears news that the slaves had tried to escape and in the process, killed their master. Once the missing slave, Hank, was found, the whole lot was to be hanged. Hank telegraphs Camelot and tells Clarence to send Launcelot to their rescue.
Hank is caught trying to buy a costume and the execution is set to take place before Launcelot and his knights can reach London in time. Just as the sheriffs place a noose around Arthur's neck, Hank spies an amazing sightLauncelot and 500 knights streaming into the square on bicycles. The day is saved in a ridiculous and spectacular showjust as Hank wanted it.
Upon his return to Camelot, the Yankee receives notice that Sir Sagramore has returned and has set a date for their combat. The battle is to take place in front of the court and spectators, and the combatants are to bring the weapons of their choice. Sir Sagramore enters the lists with 'magical' armor and tools created by Merlin while Hank comes in gymnast tights and a lasso. He succeeds in tying Sir Sagramore and eight other knights, but Merlin steals his lariat through sleight of hand and Sir Sagramore challenges him again. This time, Hank pulls out a pistol and kills all challengers. After his ninth casualty, the knights of the Round Table back down and cede him supremacy. For Hank, he has "broken the back of knight errantry."
The very next day, Hank unveils his civilization. Slavery is abolished and Hank openly works to make England and industrial, modern nation. Over the next three years, he builds a stock exchange, a train system and puts the knights and nobility in new functions in his economy. He also marries Sandy and they have a child named Hello-Central; Sandy believed the words were the names of a lost loved-one when Hank cried them out in his sleep.
Hello-Central falls ill and the doctors advise Hank to take her to the French seaside for her recuperation. When a supply ship Hank sends to England never returns, he becomes suspicious and sails home himself. He finds England ghastly and changed. The streets are dark, the people scurry about frightened. When he goes to Camelot and finds Clarence, he learns that King Arthur and most of the knights of the Round Table have died in a civil war against his treacherous nephew, Mordred. The Church has intervened into the chaos and placed an interdict on England until both Mordred and their enemy, Hank are dead.
Clarence, unable to get word to Hank, was nevertheless able to prepare for the coming crisis. He has outfitted a power plant in Merlin's Cave for a siege, and has weapons and supplies ready for war. He and Hank declare a republic and retreat to their cave with fifty-two young men to wait for the battle. In order to prevent their use by the enemy, Hank blows up his beloved factories, schools, colonies and mines, effectively self-destructing his civilization. His crew creates a series of electric fences around their compound as well as a bank of land mines as the Church rallies knights to march against them.
When the knights do come, the destruction is horrible and complete. Eleven thousand are electrocuted en masse in the fences while ten thousand more are drowned in a ditch flooded with water. In wreaking this terrible destruction however, Hank has locked himself in to their own doom. If they stay, the stench and disease of the dead will kill them; if they leave, they are vulnerable to the new forces gathering against them in the Church's name.
Hank is stabbed by a survivor knight and is bedridden. An old woman comes to tend to him while he writes his memoirs. The old woman turns out to be Merlin in disguise, and he ekes out his revenge on Hank by placing him in a sleep for 1300 years. Clarence hides Hank deep in the cave and places his memoirs with himsigning a postscript in his own hand.
Mark Twain closes the book to visit Hank, now returned to the nineteenth century. He finds the Yankee sleeping, disturbed by terrible nightmares of the battle and dreaming of his lost wife and child. The wretched Hank is slipping into death as he dreams of a past he can never reclaim.