Twain's A Connecticut Yankee in King Arthur's Court is the story of Hank Morgan, firearms manufacturing superintendent at a factory in Connecticut, and his transportation through time and space to the realm of King Arthur. Stranded in time for unknown reasons, Morgan quickly uses his technical proficiency to begin building a name for himself and to right perceived social wrongs. Twain's novel is an exploration of medieval society and the roles of technology and morality in war.
The novel is a comedy that sees 6th-Century England and its medieval culture through Hank Morgan's view; he is a 19th-century resident of Hartford, Connecticut, who, after a blow to the head, awakens to find himself inexplicably transported back in time to early medieval England where he meets King Arthur himself. The fictional Mr. Morgan, who had an image of that time that had been colored over the years by romantic myths, takes on the task of analyzing the problems and sharing his knowledge from 1300 years in the future to modernize, Americanize, and improve the lives of the people.
In addition, many passages are quoted directly from Sir Thomas Malory's Le Morte d'Arthur , a medieval Arthurian collection of legends and one of the earlier sources. The narrator who finds the Yankee in the "modern times" of Twain's nineteenth century is reading the book in the museum in which they both meet; later, characters in the story retell parts of it in Malory's original language. A chapter on medieval hermits also draws from the work of William Edward Hartpole Lecky.
The story begins as a first-person narrative in Warwick Castle, where a man details his recollection of a tale told to him by an "interested stranger" who is personified as a knight through his simple language and familiarity with ancient armor.
After a brief tale of Sir Lancelot of Camelot and his role in slaying two giants from the third-person narrative—taken directly from Le Morte d'Arthur —the man named Hank Morgan enters and, after being given whiskey by the narrator, he is persuaded to reveal more of his story. Described through first-person narrative as a man familiar with the firearms and machinery trade, Hank is a man who had reached the level of superintendent due to his proficiency in firearms manufacturing, with two thousand subordinates. He describes the beginning of his tale by illustrating details of a disagreement with his subordinates, during which he sustained a head injury from a "crusher" to the head caused by a man named "Hercules" using a crowbar. After passing out from the blow, Hank describes waking up underneath an oak tree in a rural area of Camelot, where he soon encounters the knight Sir Kay, riding by. Kay challenges him to a joust, which is quickly lost by the unweaponed, unarmored Hank as he scuttles up a tree. Kay captures Hank and leads himtowards Camelot castle. Upon recognizing that he has time-traveled to the sixth century, Hank realizes that he is the de facto smartest person on Earth, and with his knowledge he should soon be running things.
Hank is ridiculed at King Arthur's court for his strange appearance and dress and is sentenced by King Arthur's court (particularly the magician Merlin) to burn at the stake on 21 June. By a stroke of luck, the date of the burning coincides with a historical solar eclipse in the year 528, of which Hank had learned in his earlier life. (In reality, the solar eclipses nearest in time to 21 June, both partial, both in the Southern Hemisphere at maximum, in 528 occurred on 6 March and 1 August. ) While in prison, he sends the boy he christens Clarence (whose real name is Amyas le Poulet) to inform the King that he will blot out the sun if he is executed. Hank believes the current date to be 20 June; however, it is actually the 21st when he makes his threat, the day that the eclipse will occur at 12:03 p.m. When the King decides to burn him, the eclipse catches Hank by surprise. But he quickly uses it to his advantage and convinces the people that he caused the eclipse. He makes a bargain with the King, is released, and becomes the second most powerful person in the kingdom.
Hank is given the position of principal minister to the King and is treated by all with the utmost fear and awe. His celebrity brings him to be known by a new title, elected by the people— "The Boss". However, he proclaims that his only income will be taken as a percentage of any increase in the kingdom's gross national product that he succeeds in creating for the state as Arthur's chief minister, which King Arthur sees as fair. Although the people fear him and he has his new title, Hank is still seen as somewhat of an equal. The people might grovel to him if he were a knight or some form of nobility, but without that, Hank faces problems from time to time, as he refuses to seek to join such ranks.
After being made "the Boss", Hank learns about medieval practices and superstitions. Having superior knowledge, he is able to outdo the alleged sorcerers and miracle-working church officials. At one point, soon after the eclipse, people began gathering, hoping to see Hank perform another miracle. Merlin, jealous of Hank having replaced him both as the king's principal adviser and as the most powerful sorcerer of the realm, begins spreading rumors that Hank is a fake and cannot supply another miracle. Hank secretly manufactures gunpowder and a lightning rod, plants explosive charges in Merlin's tower, then places the lightning rod at the top and runs a wire to the explosive charges. He then announces (during a period when storms are frequent) that he will soon call down fire from heaven and destroy Merlin's tower, then challenges Merlin to use his sorcery to prevent it. Of course, Merlin's "incantations" fail utterly to prevent lightning striking the rod, triggering the explosive charges and leveling the tower, further diminishing Merlin's reputation.
Hank Morgan, in his position as King's Minister, uses his authority and his modern knowledge to industrialize the country behind the back of the rest of the ruling class. His assistant is Clarence, a young boy he meets at court, whom he educates and gradually lets in on most of his secrets, and eventually comes to rely on heavily. Hank sets up secret schools, which teach modern ideas and modern English, thereby removing the new generation from medieval concepts, and secretly constructs hidden factories, which produce modern tools and weapons. He carefully selects the individuals he allows to enter his factories and schools, seeking to select only the most promising and least indoctrinated in medieval ideas, favoring selection of the young and malleable whenever possible.
As Hank gradually adjusts to his new situation, he begins to attend medieval tournaments. A misunderstanding causes Sir Sagramore to challenge Hank to a duel to the death; the combat will take place when Sagramore returns from his quest for the Holy Grail. Hank accepts, and spends the next few years building up 19th-century infrastructure behind the nobility's back. At this point, he undertakes an adventure with a wandering girl named the Demoiselle Alisande a la Carteloise—nicknamed "Sandy" by Hank in short order—to save her royal "mistresses" being held captive by ogres. On the way, Hank struggles with the inconveniences of plate armor (actually an anachronism, which would not be developed until the High Middle Ages or see widespread use until the Late Middle Ages), and also encounters Morgan le Fay. The "princesses", "ogres", and "castles" are all revealed to be actually pigs owned by peasant swineherds, although to Sandy they still appear as royalty. Hank buys the pigs from the peasants and the two leave.
On the way back to Camelot, they find a travelling group of pilgrims headed for the Valley of Holiness. Another group of pilgrims, however, comes from that direction bearing the news that the valley's famous fountain has run dry. According to legend, long ago the fountain had gone dry before as soon as the monks of the valley's monastery built a bath with it; the bath was destroyed and the water instantly returned, but this time it has stopped with no clear cause. Hank is begged to restore the fountain, although Merlin is already trying. When Merlin fails, he claims that the fountain has been corrupted by a demon, and that it will never flow again. Hank, in order to look good, agrees that a demon has corrupted the fountain but also claims to be able to banish it; in reality, the "fountain" is simply leaking. He procures assistants from Camelot trained by himself, who bring along a pump and fireworks for special effects. They repair the fountain and Hank begins the "banishment" of the demon. At the end of several long German language phrases, he says "BGWJJILLIGKKK", which is simply a load of gibberish, but Merlin agrees with Hank that this is the name of the demon. The fountain restored, Hank goes on to debunk another magician who claims to be able to tell what any person in the world is doing, including King Arthur. However, Hank knows that the King is riding out to see the restored fountain, and not "resting from the chase" as the "false prophet" had foretold to the people. Hank correctly states that the King will arrive in the valley.
Hank has an idea to travel amongst the poor disguised as a peasant to find out how they truly live. King Arthur joins him, but has extreme difficulty in acting like a peasant convincingly. Although Arthur is somewhat disillusioned about the national standard of life after hearing the story of a mother infected with smallpox, he still ends up getting Hank and himself hunted down by the members of a village after making several extremely erroneous remarks about agriculture. Although they are saved by a nobleman's entourage, the same nobleman later arrests them and sells them into slavery.
Hank steals a piece of metal in London and uses it to create a makeshift lockpick. His plan is to free himself, the king, beat up their slave driver, and return to Camelot. However, before he can free the king, a man enters their quarters in the dark. Mistaking him for the slave driver, Hank rushes after him alone and starts a fight with him. They are both arrested. Although Hank lies his way out, in his absence the real slave driver has discovered Hank's escape. Since Hank was the most valuable slave— he was due to be sold the next day — the man becomes enraged and begins beating his other slaves, who fight back and kill him. All the slaves, including the king, will be hanged as soon as the missing one — Hank — is found. Hank is captured, but he and Arthur are rescued by a party of knights led by Lancelot, riding bicycles. Following this, the king becomes extremely bitter against slavery and vows to abolish it when they get free, much to Hank's delight.
Sagramore returns from his quest, and fights Hank. Hank defeats him and seven others, including Galahad and Lancelot, using a lasso. When Merlin steals Hank's lasso, Sagramore returns to challenge him again. This time, Hank kills him with a revolver. He proceeds to challenge the knights of England to attack him en masse, which they do. After he kills nine more knights with his revolvers, the rest break and flee. The next day, Hank reveals his 19th century infrastructure to the country. With this fact he was called a wizard as he told Clarence to do so as well.
Three years later, Hank has married Sandy and they have a baby. While asleep and dreaming, Hank says, "Hello-Central"— a reference to calling a 19th-century telephone operator — and Sandy believes that the mystic phrase a good name for the baby, and names it accordingly. However, the baby falls critically ill and Hank's doctors advise him to take his family overseas while the baby recovers. In reality, it is aploy by the Catholic Church to get Hank out of the country, leaving the country without effective leadership. During the weeks that Hank is absent, Arthur discovers Guinevere's infidelity with Lancelot. This causes a war between Lancelot and Arthur, who is eventually killed by Sir Mordred.
The church then publishes "The Interdict" which causes all people to break away from Hank and revolt. Hank meets with his good friend Clarence who informs him of the war thus far. As time goes on, Clarence gathers 52 young cadets, from ages 14 to 17, who are to fight against all of England. Hank's band fortifies itself in Merlin's Cave with a minefield, electric wire and Gatling guns. The Catholic Church sends an army of 30,000 knights to attack them, but the knights are slaughtered by the cadets wielding Hank's modern weaponry.
However, Hank's men are now trapped in the cave by a wall of dead bodies. Hank attempts to go offer aid to any wounded, but is stabbed by the first wounded man he tries to help, Sir Meliagraunce. He is not seriously injured, but is bedridden. Disease begins to set in amongst them. One night, Clarence finds Merlin weaving a spell over Hank, proclaiming that he shall sleep for 1,300 years. Merlin begins laughing deliriously, but ends up electrocuting himself on one of the electric wires. Clarence and the others all apparently die from disease in the cave.
More than a millennium later, the narrator finishes the manuscript and finds Hank on his deathbed having a dream about Sandy. He attempts to make one last "effect", but dies before he can finish it.