Milo is a boy bored by the world around him; every activity seems a waste of time. He arrives home from another boring day at school to find a mysterious package. Among its contents are a small tollbooth and a map of "the Lands Beyond", illustrating the Kingdom of Wisdom (which will also guide the reader from its place on the endpapers of the book). Attached to the package is a note "For Milo, who has plenty of time". Warned by an included sign to have his destination in mind, he decides without much thought to go to Dictionopolis, assuming this is a pretend game to be played on the floor of his room. He maneuvers through the tollbooth in his electric toy car, and instantly finds himself driving on a road that is clearly not in his city apartment.
Milo begins with Expectations, a pleasant place where he starts on Wisdom's road. In Expectations, he seeks directions from the Whether Man, who is full of endless talk. As Milo drives on, he daydreams and soon is paying no attention at all, and gets lost in the Doldrums, a colorless place where nothing ever happens. Milo is soon joining the inhabitants, the Lethargarians, in killing time there, a pastime angrily interrupted by the arrival of Tock, a talking oversize dog with an alarm clock on each side (a "watchdog"), who tells Milo that only by thinking can he get out of the Doldrums. Head abuzz with unaccustomed thoughts, Milo is soon back on his road, and the watchdog joins him on his journey through Wisdom.
Milo and Tock travel to Dictionopolis, one of two capital cities of the divided Kingdom of Wisdom, and home to King Azaz the Unabridged. They meet King Azaz's cabinet officials and visit the Word Market, wherein are bought and sold the words and letters that empower the world. A fight between the Spelling Bee and the blustering Humbug breaks up the market, and Milo and Tock are arrested by the very short Officer Shrift. In prison, Milo meets the Which (not to be confused with Witch), also known as Faintly Macabre, long in charge of which words should be used in Wisdom. She tells him how the two rulers, King Azaz and his brother, the Mathemagician, had two adopted younger sisters, Rhyme and Reason, to whom everyone came to settle disputes. All lived in harmony until the rulers disagreed with the princesses' decision that letters (championed by Azaz) and numbers (by the Mathemagician) were equally important. They banished the princesses to the Castle in the Air, and since then, the land has had neither Rhyme nor Reason.
Milo and Tock leave the dungeon. King Azaz hosts them at a banquet where the guests literally eat their words, served to them on plates. After the meal, King Azaz lets Milo and Tock talk themselves into a dangerous quest to rescue the princesses. Azaz flatters the Humbug into being their guide, and boy, dog and insect set off for the Mathemagician's capital of Digitopolis as they must gain his approval before they can begin their quest.
Along the way, they meet such characters as Alec Bings, a little boy suspended in the air who sees through things and who will grow down until he reaches the ground. Milo then loses time in substituting for Chroma the Great, a conductor whose orchestra creates the colors of the world.
In Digitopolis, they meet the Mathemagician, who is still angry at Azaz, and who will not give his blessing to anything that his brother has approved. Milo maneuvers him into saying he will permit the quest if the boy can show the two have concurred on anything since they banished the princesses. To the number wizard's shock, Milo proves that the two have agreed to disagree, and the Mathemagician gives his reluctant consent.
In the Mountains of Ignorance, the journeyers contend with demons like the Terrible Trivium and the Gelatinous Giant. After overcoming testing obstacles and their own fears, they reach the Castle in the Air. Princesses Rhyme and Reason welcome Milo and agree to return to Wisdom. Unable to enter the castle, the demons cut it loose, letting it drift away, but Milo realizes Tock can carry them down because time flies. The demons pursue, but the armies of Wisdom repel them. Rhyme and Reason heal the divisions in the old Kingdom of Wisdom, Azaz and the Mathemagician are reconciled, and all enjoy a three-day celebration.
Milo says goodbye and drives back through the tollbooth. Suddenly he is back in his own room, and discovers he has been gone only an hour, though his journey seemed to take weeks. He awakens the next day with plans to return to the kingdom, but finds the tollbooth gone when he gets home from school. A note instead is there, "For Milo, who now knows the way." The note states that the tollbooth is being sent to another child who needs help finding his direction in life. Milo is somewhat disappointed but agrees and looks at a now-interesting world around him, concluding that even if he found a way back, he might not have time to go, for there is so much to do right where he is.