The 29-year-old's previous deal was due to expire in 2028, but the Spanish champions have moved quickly to extend his stay following his impressive start to the season.
Raphinha has scored 19 goals in just 13 appearances in all competitions this campaign, including a brace in Tuesday's 3-0 Champions League victory over Aston Villa.
"I'm very proud to have renewed my contract, considering everything we've achieved individually and collectively," Raphinha said. "If my legs allow me to keep going, I'd love to finish my career at this club."
Raphinha has enjoyed a remarkable transformation under Hansi Flick, particularly after being moved into a central attacking role following the departures of Robert Lewandowski and Ferran Torres.
Having previously established himself as a key figure on the left wing, the former Leeds United forward has adapted brilliantly to playing as Barcelona's No.9, delivering goals and assists as the club have won 13 of their first 15 matches.
He also addressed concerns about his fitness ahead of Brazil's international fixtures, revealing that he was not yet fully recovered. "The national team coach will know how to manage my minutes. We've spoken and he knows I'm not at 100% yet. Culers shouldn't be worried," he said.
Raphinha's contract extension comes at an important stage of Barcelona's season, with Flick's side preparing for Sunday's top-of-the-table La Liga clash away to Atletico Madrid.