Segel was born January 18, 1980, in Los Angeles, to Jillian (née Jordan) and Alvin Segel, a lawyer. He grew up in the Pacific Palisades neighborhood. His father is Jewish, whereas his mother is Christian. He has stated that he was raised Jewish, as well as "a little bit of everything".
Segel went to Hebrew school and had a Bar Mitzvah ceremony, and also attended St. Matthew's Parish School, a private Episcopal school. He wore a Superman cape underneath his clothing until he was 13, "just in case there was trouble." He has an older brother, Adam, and a younger sister, Alison.
Following elementary school and middle school, Segel completed his high school studies at Harvard-Westlake School, where his 6 ft 4 in (1.93 m) frame helped him as an active member of the 1996 and 1997 CIF state champion boys' basketball team. He won a slam dunk contest in high school and he was nicknamed "Dr. Dunk." He was a backup to the team's star center, Jason Collins, who went on to play in the NBA.
Segel's first major role was as stoner "freak" Nick Andopolis on the critically acclaimed but short-lived 1999 NBC comedy-drama series Freaks and Geeks. The series revolved around a group of suburban Detroit high school students circa 1980. Segel personally composed a song for his character, Nick, to sing to the lead female character, Lindsay (Linda Cardellini).
Segel had recurring roles on CSI: Crime Scene Investigation as Neil Jansen and on Undeclared as Eric. He played Marshall Eriksen on the CBS sitcom How I Met Your Mother; he had previously stated he would move on to other projects in 2013 when his contract expired, but was successfully convinced to finish the series after its ninth season in 2014.
Feature film appearances include Slackers, SLC Punk!, The Good Humor Man, and Dead Man on Campus. In 2007, he appeared in Knocked Up, directed by Freaks and Geeks producer Judd Apatow. Segel starred in the lead role of 2008's Forgetting Sarah Marshall, a film he wrote and Apatow produced with Shauna Robertson for Universal Pictures. He also starred in I Love You, Man, which was released on March 20, 2009 by DreamWorks.
In Forgetting Sarah Marshall, Segel's character writes a "Dracula" musical performed by puppets. He also appeared in a full frontal nude scene in the film. In an interview, he stated that the Dracula musical with puppets, as well as being broken up with while naked, were real experiences he wrote into the movie. Those cloth creatures were custom-made by the Jim Henson Company, and the experience emboldened Segel to pitch his concept for a Muppets movie. Segel performed a song from the film, "Dracula's Lament", on the 1000th episode of The Late Late Show with Craig Ferguson.
For the 2010 comedy Get Him to the Greek, Segel co-wrote most of the soundtrack's music which was performed by the fictional band Infant Sorrow. He also appeared on The Late Late Show with Craig Ferguson and sang an original song entitled "Wonky Eyed Girl".
In 2010, he voiced Gru's arch-rival Vector in the Universal's CGI animated film, Despicable Me and appeared as "Horatio" in a fantasy comedy film Gulliver's Travels directed by Rob Letterman and very loosely based on Part One of the 18th-century novel of the same name by Jonathan Swift. Segel appeared in Bad Teacher, starring Cameron Diaz, which opened in June 2011. He played gym teacher and thwarted suitor Russell Gettis. Along with Nicholas Stoller, Segel approached Disney in 2007 to write the latest Muppets film. Disney was unsure on how to take the request, as Segel had just done frontal nudity in Forgetting Sarah Marshall, but after realizing that he was an avid fan, the project was approved. Segel stated that he wanted to do the film because the last film in the series to be released in theaters was Muppets from Space in 1999, and he felt that the younger generation was missing out on enjoying one of his childhood favorites.
Segel decided not to star in the sequel to The Muppets, Muppets Most Wanted. He filmed The Five-Year Engagement, with Emily Blunt, in spring 2011, in Michigan, and the film was released on April 27, 2012. Segel will also be in the cast of a film based on the 2012 Quebec maple syrup heist, which will be directed by Seth Gordon.
In 2013, Segel revealed he was working on a series of young adult novels, based on a story he conceived when he was 21. In the fall of 2014, the first novel of the series Nightmares!, co-written with Kirsten Miller, was released, with the followup coming out the following year.
In 2015, Segel received praise for his portrayal of the late author David Foster Wallace in the independent biographical drama film The End of the Tour. For his performance, he earned a Independent Spirit Award nomination for Best Male Lead.
Segel is an ordained minister with the Universal Life Church. He performed a wedding ceremony on The Tonight Show on July 6, 2010, for a couple that solicited his services by placing wanted pictures of him around his home town and the bar he frequently visited.