Barnes was born on 20 August 1981 in southwest London to Patricia Becker, a relationship psychotherapist, and Thomas Barnes, a psychiatrist and professor. He has a younger brother, Jack. Barnes cites his mother's Jewish South African childhood, his father's scientific education, and his attendance at what he felt was a "vaguely Christian" school where he "liked the hymns" as formative influences.
Barnes was educated at two independent schools for boys: Homefield Preparatory School in Sutton and King's College School in Wimbledon. In King's, he sang in choirs and played percussions (drums and piano) in jazz orchestras and concert bands. In 1997 he began his career in musical theatre by joining the National Youth Music Theatre where, at age sixteen, he gave his first performance as a drummer in the West End musical adaptation of Bugsy Malone. Prior to university, he spent two years singing, television presenting, and working with entertainment svengali Simon Fuller to open a jazz club and release an album, both of which did not materialise.
Barnes then studied English literature and drama at Kingston University, appearing and directing in productions such as Don Juan (as the lead), The Golden Age, Exposure and The Zoo Story. He won the English Prize for writing essays on themes from Harry Potter and The Hobbit. While working at the theatre on intense acts such as The Ragged Child, The Dreaming, Loving Ophelia, Sex, Chips & Rock n' Roll, he briefly joined the boyband Hyrise, who performed in Eurovision: Making Your Mind Up, to find the UK's entry for the 2004 Eurovision Song Contest, with 'Leading Me On'. Graduating in 2004 with a BA (Hons) in Drama with English Literature, he was the university's first drama student to achieve First Class Honours. In 2008, he was inducted in the university's Wall of Fame, the youngest to be featured among more than twenty accomplished alumni.