Shepard was born in 1976 in Casper, Wyoming; he was the first of two sons born to Judy (née Peck) and Dennis Shepard. His younger brother, Logan, was born in 1981. The two siblings had a close relationship. Matthew attended Crest Hill Elementary School, Dean Morgan Junior High School, and Natrona County High School for his freshman through junior years. As a child, he was "friendly with all his classmates," but was targeted for teasing due to his small stature and lack of athleticism. He developed an early interest in politics. Saudi Aramco hired his father in the summer of 1994, and Shepard's parents subsequently resided at the Saudi Aramco Residential Camp in Dhahran. During that time, Shepard attended the American School in Switzerland (TASIS), from which he graduated in May 1995. There, he participated in theater and took German and Italian courses. He then attended Catawba College in North Carolina and Casper College in Wyoming, before settling in Denver, Colorado. Shepard became a first-year political science major at the University of Wyoming in Laramie with a minor in languages, and was chosen as the student representative for the Wyoming Environmental Council.