Tom Canty (youngest son of a family living with the dregs of society in Offal Court) has always aspired to a better life, encouraged by the local priest (who has
taught him to read and write). Loitering around the palace gates one day, he sees a prince (the Prince of Wales – Edward VI). Tom is nearly caught and
beaten by the Royal Guards; however, Edward stops them and invites Tom into his palace chamber. There the two boys get to know one another, fascinated
by each other's life and their uncanny resemblance. They decide to switch clothes "temporarily". Edward leaves in a hurry before the boys are caught at their
game, snatching up an article of national importance (which the reader later learns is the Great Seal of England). Soon Prince Edward is trying to escape the
brutality of Tom's abusive drunken father. Tom, posing as the prince, tries to cope with court customs and manners. His fellow nobles and palace staff think
"the prince" has an illness which has caused memory loss and fear he will go mad. They repeatedly ask him about the missing "Great Seal", but he knows
nothing about it; however, when Tom is asked to sit in on judgments, his common-sense observations reassure them his mind is sound.
Edward soon meets Miles Hendon, a soldier and nobleman returning from war. Although Miles does not believe Edward's claims to royalty, he humors him
and becomes his protector. Meanwhile, news reaches them that King Henry VIII has died and Edward is now the king.
As Edward experiences the brutish life of a pauper firsthand, he becomes aware of the stark class inequality in England. In particular, he sees the harsh,
punitive nature of the English judicial system where people are burned at the stake, pilloried, and flogged. He realizes that the accused are convicted on
flimsy evidence (and branded – or hanged – for petty offenses), and vows to reign with mercy when he regains his rightful place. When Edward unwisely
declares to a gang of thieves that he is the king and will put an end to unjust laws, they assume he is insane and hold a mock coronation.
After a series of adventures (including a stint in prison), Edward interrupts the coronation as Tom is about to celebrate it as King Edward VI. Tom is eager to
give up the throne; however, the nobles refuse to believe that the beggarly child Edward appears to be is the rightful king until he produces the Great Seal
that he hid before leaving the palace. Tom declares that if anyone had bothered to describe the seal he could have produced it at once, since he had found it
inside a decorative suit of armor (where Edward had hidden it) and had been using it to crack nuts.
Edward and Tom switch back to their original places and Miles is rewarded with the rank of earl and the family right to sit in the presence of the king. In
gratitude for supporting the new king's claim to the throne, Edward names Tom the "king's ward" (a privileged position he holds for the rest of his life). They
live happily for sometime. But it is noted that whereas Tom lived a long life, Edward died young.