The youngest son of a poor family, Tom Canty lives in the relatively poor area of London known as Offal Court. Tom has always known that he was made for better things, and aspires to a more well-to-do lifestyle. The local parish priest is very encouraging to him, and teaches him to read and write. Tom spends alot of time hanging around the gates of the palace, eventually this pays off; he meets Edward Tudor, Prince of Wales. This is seen as somewhat of a threat to the Prince's safety by his guards, who want to whisk him off and beat him for his insolence, but Edward speaks up for Tom and asks him to accompany him into the palace chamber. The two boys begin to strike up a friendship; despite their different stations in life, and their wildly divergent upbringings, what they have in common is that they are two young boys of the same age who happen to look very similar to each other. They are both fascinated by the other's life. The wildest coincidence is that they share the same birthday. One thing leads to another and they decide to switch places for the day.
The Prince goes outside dressed like Tom. He is carrying an important document with him. The guards don't recognize him and they drive him as far as the outer walls of the palace. When he is dropped off he makes his own way to Tom's family's home. It is a brutal experience; Tom's father is an alcoholic and extremely abusive. He manages to escape from him and he meets a soldier, nobleman Miles Hendon, who is returning from war. Miles doesn't believe a word of the boy's story about being a prince disguised as a poor boy, but he likes the boy and he decides to humor him by pretending that he believes what he is saying. He becomes his wing man, and protector.
In the middle of the boys' identity switch, news arrives that King Henry VIII has died, which means that Prince Edward is now King of England. Tom is disguised as Edward and struggling to get used to the way in which the Court works, and with its customs. Because he does not seem to know what is what, everyone believes him to have some kind of illness that causes loss of memory. They are worried that he will eventually go mad. They ask him over and over again about the Great Seal of England but he remembers nothing about it, or where it is. They are slightly placated when Tom is asked to view judgement proceedings and makes some very sound observations. He cannot be that mad if he still has this much common sense.
Edward is finding out what life as a pauper in London is really like. It is difficult, brutal, and unpleasant, a world away from where he has come from. He begins to realize that there is extreme class inequality in England, especially when it comes to the judicial system. It is a system based entirely on punishment. Edward is genuinely affected by what he sees and makes a promise to himself that as King, he will be far more benevolent and kind than his predecessors.
Edward experiences an awful lot of life in a very short time whilst he is disguised as Tom, but returns to the palace as Tom's coronation is about to take place, The resemblance between the boys leaves everyone aghast, but Edward is treated as if he is a pauper spinning a tale. Nobody believes that he is really a prince wearing Tom's clothing, until he produces the Great Seal of England that he had taken from the palace when he left, and which they have been searching for since his departure.
Edward and Tom resume their own identities just in time for Edward to be crowned King of England. The loyal and protective Miles becomes an earl and his family are allowed to sit in the presence of the king, a high honor. Because Tom spoke up for him and told the noblement that the story of their changing identities is true, he is given the title "King's Ward", which is a very priviledged position bestowed on him for life.
As for Edward, he did not reign for very long, but whilst King he led his people with kindness and benevolence, in thanks to the things he experienced when living as a pauper.