Pilkey was born in Cleveland, Ohio on March 4, 1966, to Barbara and David Pilkey Sr. He has one older sister. Pilkey was diagnosed with attention deficit hyperactivity disorder and dyslexia as a child. In elementary school in Elyria, Ohio, Pilkey was frequently reprimanded for his behavior in class and thus usually sat at a desk in the school hallway, where he created the "Captain Underpants" character. Pilkey entered his first book, "World War Won", in a national competition for student authors and won in his age category. The book's publication in 1987 was included in the award.