After being formed and finishing third in the seventh series of The X Factor in 2010, One Direction were signed to Syco Music. The number was written by August Rigo and Steve Mac, and was produced by Mac. One Direction premiered the single on BBC Radio 1 on 19 October 2011, with confirmation that it would serve as the second cut from Up All Night, following their debut single, "What Makes You Beautiful", which topped the UK Singles Chart in September of that year. Member Zayn Malik, in an October interview with Digital Spy, characterised "Gotta Be You" as "a bit more emotive" than their debut single.
Both USA Today writer Brian Mansfield, who appreciated the lyrical content, and PopMatters contributor Zachary Houle, who favoured the instrumentation, described "Gotta Be You" as one of Up All Night's highlights. Billboard reviewer Jason Lipshutz commended the vocal elements at play in its refrain and the track's "smooth" lyricism. Robert Copsey for Digital Spy opined that the single's memorable refrain is its strongest attribute and rated it four out of five stars. Matthew Horton of Virgin Media classified the song as one of the record's "superior tracks", and credited the ballad with keeping the album's "pecker up". Cosmopolitan's Sarah Kwong lauded the lyrics and instrumentation of "Gotta Be You" and noted its appeal to a more mature audience in comparison to their debut single "What Makes You Beautiful". Writing for Allmusic, Matthew Chisling, however, described the ballad as "a bit tepid." 
"Gotta Be You" debuted and peaked at number three on the Irish Singles Chart in the week ending 17 November 2011, marking the group's second top five appearance in Ireland. In the United Kingdom, the piece sold substantially less than their first single "What Makes You Beautiful", selling 59,461 copies in its first week. Despite the single reaching number one on the mid-week chart update, it entered the UK Singles Chart dated 20 November 2011 at number three behind the seventh week sales of Rihanna's "We Found Love" and the release of "Good Feeling" by Flo Rida. The song marks their second top ten hit and was One Direction's third best-selling track in the UK by August 2012. Upon the release of Up All Night in the United States, "Gotta Be You" did not enter the US Billboard Hot 100, but peaked at number 24 on the Bubbling Under Hot 100 Singles chart in the week of 28 April 2012.