In the city of Piqua, Ohio, two fourth-grade friends and next-door neighbors named George Beard (Kevin Hart) and Harold Hutchins (Thomas Middleditch) are the pranksters at their school, Jerome Horwitz Elementary School. They excessively pull numerous pranks on the cruel teachers, many of which are directed at their mean-spirited principal, Benjamin Krupp (Ed Helms), putting the two at odds with him. The duo also create comic books about a superhero named Captain Underpants, who fights crime while wearing underwear and a cape. They distribute these to their schoolmates through a comic company called Treehouse Comix Inc., located in their treehouse. George and Harold’s pranks come to an apparent end after they’re caught tampering with a toilet invention, the Turbo Toilet 2000, made by the school’s local snitch and intellectual, Melvin Sneedly (Jordan Peele), on video. Finally having solid proof of the boys’ antics, Mr. Krupp excitedly prepares to annihilate their friendship by putting them in separate classes.
To prevent this, George hypnotizes Mr. Krupp with a 3D Hypno Ring he received out of a cereal box. The boys see that Mr. Krupp bears an odd resemblance to Captain Underpants without his toupee and command him to be Captain Underpants. The boys soon learn the severity of their actions when “Captain Underpants” begins causing problems around Piqua. To prevent these issues, the boys take him to their treehouse, where they discover that they can turn Captain Underpants back into Mr. Krupp by splashing water on him and can turn him back into Captain Underpants by snapping their fingers. Knowing that Mr. Krupp will continue trying to put them in separate classes, they decide to settle with Captain Underpants but insist that he be dressed up as Mr. Krupp under the pretense of a “secret identity,” to which Captain Underpants agrees. His sudden personality change even manages to attract the attention (and affection) of the school’s shy lunch lady, Edith (Kristen Schaal).