The narrative begins in the Land of Oz, where a young boy named Tip flees his cruel guardian, the sorceress Mombi. Using a magical powder stolen from the witch, Tip brings to life a wooden dummy with a carved pumpkin head, whom he names Jack Pumpkinhead. Shortly after, they animate a wooden saw-horse to serve as Jack's mount and avoid the wear on his fragile joints.
Seeking refuge from pursuit, the peculiar pair travels toward the magnificent Emerald City. Along the way, they encounter the Educated Woggle-Bug, an insect magnified to human size, who joins their party. Upon reaching the capital, they discover that the city has been captured by an army of rebellious girls led by General Jinjur, who have overthrown the ruling Scarecrow.
Fleeing the conquerors once more, the companions build a flying machine called the Gump, constructed from sofas, palm leaves, and the head of an antlered beast. Powered by the last remnants of the magic powder, the Gump transports them across dangerous mountains and into the southern domain of Glinda the Good, a powerful and benevolent sorceress.
Glinda agrees to help restore order and marches an army to retake the Emerald City. During the search for the fugitive witch Mombi, the sorceress uncovers a long-kept secret. The wizard who originally usurped the throne had concealed the true heir, Princess Ozma, by transforming her into a boy.
Revealed as the rightful queen of Oz, Tip is restored to his original female form through magic and assumes the throne as Princess Ozma. Order is successfully restored to the kingdom, Jinjur's rebellion ends, and the companions return to their respective homes, leaving Oz under the rule of its rightful monarch.