Hernández was born in Guadalajara, Jalisco and first played in a recreation league when he was seven years old. His father, Javier Hernández Gutiérrez, himself a previous Mexican international striker, said he never thought his son would actually make it as a professional. Hernández joined C.D. Guadalajara at the age of nine and signed his first professional contract when he was 15. He was set to play in the 2005 FIFA U-17 World Championship, but an injury sidelined him from the team that ultimately won the championship.
Hernández began playing with Chivas' lower division team, Chivas Coras in Tepic, Nayarit in the 2005–06 season. He made his debut for Chivas in the 2006 Apertura in a win over Necaxa at Estadio Jalisco. With the score at 3–0, Hernández came on as a substitute for Omar Bravo in the 82nd minute, before scoring the fourth goal of the game five minutes later. It was his only goal in seven appearances in 2006–07. He made a further six appearances in 2007–08 without scoring.
Hernández made ten appearances in the 2008 Apertura without scoring, but he scored four goals in fifteen appearances in the 2009 Clausura. In the 2009 Apertura, Hernández finished as the joint-third top scorer, with eleven goals in seventeen appearances. He started the 2010 Torneo Bicentenario with eight goals in five games.He finished as a joint-leader in the goalscoring chart for the 2010 Torneo Bicentenario, with ten goals in eleven games.
Manchester United were first made aware of Hernández in October 2009; a scout went to Mexico that December and reported positively after watching a few games. Because of Hernández's age, the club originally planned to wait before making a move to sign him, but his potential involvement with the national team at the World Cup rushed the club into making a bid. United's chief scout, Jim Lawlor, was sent to Mexico for three weeks in February and March to watch Hernández and filed another positive report on him, before the club solicitor went over to Mexico to finalise the paperwork.
On 8 April 2010, Hernández agreed a deal to sign for Manchester United for an undisclosed fee, subject to a work permit application. The previous day, Hernández had been present at Manchester United's Champions League quarter-final win over Bayern Munich at Old Trafford. The deal was conducted in complete secrecy; Hernández's agent was kept in the dark, as was his grandfather Tomás Balcázar, who thought Hernández was going on a trip to Atlanta in the United States. As part of the deal, United played a friendly against Chivas to open their new stadium on 30 July. On 27 May, the work permit was granted, allowing the transfer to be made official on 1 July.