Vilanova had a recurring tumor in a saliva gland and was admitted to a hospital in Barcelona last week. The team announced his death on its website.
As Guardiola's assistant, Vilanova provided the tactical know-how that helped the coach build one of the best teams in the history of the sport, winning two Champions League titles.
Barcelona star Lionel Messi called the death a "moment of profound pain for Vilanova's family, and also for Barcelona and its fans."
"All of us who shared Barcelona's locker room with Tito are deeply affected, considering what he gave us as a person and as a professional," Messi said in a statement. "I, personally, will always hold dear the things he shared and went through with me, which I will never forget."
Former Barcelona defender Eric Abidal, who recovered from liver cancer and a liver transplant to help hoist the 2012-13 league trophy with Vilanova, wrote on Twitter: "For everything we went through together, I will always remember you, my friend. Thanks for fighting."
Spain's royal family and Prime Minister Mariano Rajoy also sent telegrams to Vilanova's family and Barcelona, according to Europa Press news agency.
Vilanova first became ill in November 2011 while an assistant to Guardiola and took a leave of absence after surgery. Vilanova returned and replaced Guardiola the next season, leading Barcelona to the Spanish league title with a record-tying 100 points.
Vilanova had a second tumor removed in December 2012 and traveled to New York several times during the season for further treatment before returning to the sidelines. In April 2013, Vilanova said he felt fine and "never thought about quitting." He finished the season before suddenly being forced to resign following a relapse in July.
As an assistant, Vilanova helped Guardiola propel Barcelona into its most successful period and transform a team led by Messi into perhaps the world's best.
With a team that also included several of the players that led Spain to the World Cup title in 2010, Barcelona won 14 of a possible 19 major trophies from 2008-12 under Guardiola before adding the league title with Vilanova in 2013.
Despite the league display, Vilanova was unable to win another Champions League title last season. Barcelona lost to eventual champion Bayern Munich 7-0 on total goals in the semifinals.
Vilanova also will be remembered for his role in a brawl in the 2010 Spanish Super Cup won by Barcelona, when Real Madrid coach Jose Mourinho poked him in the eye.
As a young player, Vilanova was at Barcelona's training academy from 1984-89 but never made it to the first team. Instead, he went on to play for clubs such as Celta Vigo and Mallorca before his career was cut short by a knee injury.
Vilanova then went into coaching and got a job with Barcelona's youth players, tutoring current players Gerard Pique, Cesc Fabregas and Messi. Vilanova left to work as sport director at third-division club Terrassa before returning to Barcelona to take over the club's "Barca B" feeder team.
Vilanova is survived by his wife, Montse Chaure, and two children. His son Adrian is currently in Barcelona's youth academy.
His funeral is Monday at Barcelona's cathedral.