2005–2015: Early work and breakthrough
Hammer's professional acting career began with small guest appearances in the television series Arrested Development, Veronica Mars, Gossip Girl, Reaper and Desperate Housewives. His first ventures into film began with a minor role in the 2006 film Flicka, as well as co-starring in a 2008 psychological thriller, Blackout. His first leading role in film came with his portrayal of the Christian evangelist Billy Graham in Billy: The Early Years, which premiered in October 2008. The film garnered Hammer a "Faith and Values Award" nomination in the Grace Award category, which is awarded for the Most Inspiring Performance in Movie or Television by Mediaguide, an organization that provides movie reviews from a Christian perspective.
After a long search, Hammer was hand-picked in 2007 by filmmaker George Miller to star in the planned superhero film Justice League: Mortal, as Bruce Wayne / Batman. The film, which was to be directed by Miller, was eventually canceled. The film's cancellation came in large part due to the looming 2007–08 Writers Guild of America strike as well as stalled budgetary rebate negotiations with the Australian Government. In 2009, he played Harrison Bergeron in 2081, based on the short story of the same name by author Kurt Vonnegut, which premiered at the Seattle International Film Festival.
In 2010, Hammer's breakthrough film role was in David Fincher's The Social Network, about the creation of Facebook. He portrayed the identical twins Cameron and Tyler Winklevoss, with actor Josh Pence serving as a body double during filming. The filmmakers utilized computer-generated imagery during post-production to superimpose Hammer's face over Pence's as well as the use of split-screen photography in certain scenes. In preparation for the film, Hammer stated that he had to learn how to row on both sides of a boat in order to play the twins, who are rowing champions. Hammer and Pence also went through 10 months of extensive twin boot camp in preparation for their roles, in order to "drill the subtle movements and speech patterns that the Winklevosses would have developed over two decades of genetic equality." This film earned Hammer his first critical plaudits, with Richard Corliss of Time magazine remarking that Hammer's portrayal of the twins was "an astonishingly subtle trompe-l'œil of special effects". For his role in the film, Hammer won Toronto Film Critics Association Awards 2010 for Best Supporting Actor.
Hammer's next role was that of the first associate director of the FBI, Clyde Tolson, in Clint Eastwood's 2011 film J. Edgar. The biographical drama, written by Dustin Lance Black, focused on the expansive career of J. Edgar Hoover, of which the titular role was portrayed by Leonardo DiCaprio. While the film received mixed reviews overall, with some pointed criticism of the makeup used to age DiCaprio and Hammer's characters, the acting was largely praised. David Denby of The New Yorker called Hammer's performance "charming", and The Hollywood Reporter's Todd McCarthy described it as "excellent". McCarthy goes on further in his review to particularly praise the chemistry between DiCaprio and Hammer, specifically in their depiction of the often speculated romantic relationship between their characters, observing that "the way the homoerotic undertones and impulses are handled is one of the best things about the film; the emotional dynamics, given all the social and political factors at play, feel entirely credible, and DiCaprio and Hammer excel during the exchanges of innuendo, covert desire, recriminations and mutual understanding." DiCaprio and Hammer both received nods at the 18th Screen Actors Guild Awards.
In January 2012, Hammer voiced the Winklevoss twins in an episode of The Simpsons titled "The D'oh-cial Network". He also co-starred with Julia Roberts and Lily Collins in Mirror Mirror which was released in the following March, playing Prince Andrew Alcott. The following year, Hammer was cast as the title role of Disney's, The Lone Ranger, alongside Johnny Depp as Tonto, in an adaptation of the radio and film serials of the character of the same name. The film, released theatrically in July 2013, was considered a box office failure, grossing only $260.5 million worldwide on a reported budget of $215 million. In 2015, he starred in director Guy Ritchie's The Man from U.N.C.L.E., a feature film adaptation of the 1960s TV show The Man from U.N.C.L.E., playing Illya Kuryakin, opposite Henry Cavill.