2004–2014
In 2004, he performed the dual roles of the Balladeer and Lee Harvey Oswald on Broadway in the revival of Stephen Sondheim's musical Assassins. In 2004, Harris played a fictionalized, hyper-womanizing, lewd version of himself in Harold & Kumar Go to White Castle, a stoner comedy film in the Harold & Kumar series. He would go on to reprise the role in the sequels Harold & Kumar Escape from Guantanamo Bay (2008) and A Very Harold & Kumar 3D Christmas (2011). In 2005, Harris portrayed Jon in the London premiere of Tick, Tick... Boom! at the Menier Chocolate Factory. He was replaced by Christian Campbell in July of that same year.
From 2005 to 2014, Harris played Barney Stinson, a serial womanizer, in the CBS ensemble sitcom How I Met Your Mother. The role earned him Emmy nominations every year from 2007 to 2010. In 2007, he worked with Mike Nelson on a comedic audio commentary set to the film Willy Wonka & the Chocolate Factory for RiffTrax. In 2008, Harris played the title role in Joss Whedon's musical web series Dr. Horrible's Sing-Along Blog. That same year, he guest-starred on Sesame Street as the Sesame Street Fairy Shoe Person. In 2009, he hosted the 7th Annual TV Land Awards and appeared as a guest judge on season 9 of American Idol. Harris provided the voice of Steve the Monkey in the Cloudy with a Chance of Meatballs film franchise (2009–2013). After a preview at San Diego Comic-Con, a musical episode of Batman: The Brave and the Bold featuring Harris as the villainous Music Meister premiered on October 23, 2009, on Cartoon Network. He has also provided his voice for the Disney California Adventure Park attraction California Screamin'.
Harris hosted the 61st Primetime Emmy Awards on September 20, 2009. On August 21, 2010, he won two Emmy Awards at the Creative Arts Emmy Awards ceremony, one of which was for his guest performance in the television series Glee. Harris hosted the 65th Primetime Emmy Awards on September 22, 2013, marking his second time hosting the event. Harris has hosted the Tony Awards four times: the 63rd Tony Awards on June 7, 2009, the 65th Tony Awards on June 12, 2011, the 66th Tony Awards on June 10, 2012, and the 67th Tony Awards on June 9, 2013. Only Dame Angela Lansbury, with five ceremonies, has hosted the Tony Awards more times. Hosting the Tony Awards has earned him four Primetime Emmy Awards in 2010, 2012, 2013 and 2014 for the 63rd, 65th, 66th and 67th, respectively.
Harris appeared in the 2010 Time 100 list of influential people. That year, Harris directed a Hollywood Bowl production of Rent; he cast his Beastly co-star Vanessa Hudgens as Mimi Márquez. Also in 2010, Harris provided voice acting for the role of the adult Dick Grayson (Nightwing) in the animated film Batman: Under the Red Hood and the beagle Lou in the film Cats & Dogs: The Revenge of Kitty Galore. On March 7, 2010, he delivered a musical number appearance at the 82nd Academy Awards. He played the lead in the indie comedy The Best and the Brightest. In December 2010, Harris hosted the Spike Video Game Awards. In 2011, Harris played the lead role of Bobby in Stephen Sondheim's Company with the New York Philharmonic in concert. That same year, he directed The Expert at the Card Table at Broad Stage's Edye in Santa Monica, California. He also starred in the 2011 film The Smurfs and its 2013 sequel The Smurfs 2. On Sept. 15, 2011, Harris received a star on the Hollywood Walk of Fame.
Harris portrayed the titular role in the first Broadway production of the rock musical Hedwig and the Angry Inch from March through August 2014. He received acclaim for the role, with Variety declaring, "It's astonishing how polished a physical performance Harris gives. Channeling his inner Rockette, along with Iggy Pop and Lou Reed by way of the Ramones, he carries off some advanced dance and acrobatic moves". The role earned Harris the 2014 Tony Award for Best Actor in a Musical. He exited the role on August 17, citing a desire to spend more time with his family. Later in 2014, Harris portrayed Desi Collings in Gone Girl, a film directed by David Fincher.
In 2014, Harris reportedly turned down the chance to replace David Letterman as host of the Late Show on CBS, stating that he feared he would get bored of the repetition that hosting a nightly talk show would entail. He also rejected the suggestion of replacing Craig Ferguson as host of The Late Late Show on the same grounds, although he later claimed he was never actually offered either job. In October 2014, Harris released a memoir titled Neil Patrick Harris: Choose Your Own Autobiography, which is structured like a Choose Your Own Adventure book. His autobiography spent two weeks on The New York Times Best Seller List.