Vettel won all his world titles with Red Bull in a four-year spell of dominance, but he will leave at the end of this season and be replaced by Russian rookie Daniil Kvyat, 20.
“I have decided to leave Red Bull at the end of this year,” the 27-year-old Vettel said in a statement on his website.
Team principal Christian Horner told reporters that Vettel had only announced his departure late on Friday, during preparations for the Japanese Grand Prix in Suzuka.
“Obviously Ferrari have made him a very attractive offer,” Horner said.
It was an announcement that stunned the paddock, coming just two days after the under-performing Vettel laughed off speculation about his future.
Two-time world champion Fernando Alonso is thought to be on his way out of Ferrari, a move which would leave a vacancy at the Italian team.
Vettel said there would be news on his next step “very soon”, adding that he had wrestled with the decision to quit the team that launched his career.
“Of course it is a big step and hard to make such a decision,” the German said on his website.
“The chance to drive in F1, the first win with Scuderia Toro Rosso, the four championship wins with Infiniti Red Bull Racing and many other great memories have bound Red Bull and myself together into a kind of family. No one can take these times away from us.
“Now I have decided to take the next step in my career… about my future plans, there will be an announcement very soon.”
Vettel graduated to Red Bull from feeder team Toro Rosso — current employer of his replacement, Kvyat — and became the sport’s youngest world champion aged 23 in 2010.
He made it four titles in a row last year, joining Michael Schumacher, Juan Manuel Fangio and Alain Prost as only the fourth driver with as many world championships.
But Vettel’s past glories have quickly faded this season. He is currently fifth in the standings and driving in the shadow not only of top team Mercedes, but also his team-mate.
The young Australian Daniel Ricciardo has won three races in his debut Red Bull season to sit third in the title race, behind Mercedes duo Lewis Hamilton and Nico Rosberg.
Vettel has totted up 39 wins and 45 pole positions with Red Bull and Toro Rosso. A move to Ferrari would be seen as a risk following a lean spell for the Italian giants.
But Vettel would be following in the footsteps of his idol Schumacher, who joined Ferrari during another slump and went on to win five world titles with the Turin-based team.
Vettel may also take encouragement from the example of Hamilton, who left long-term employer McLaren in 2012 and is now on top of the drivers’ standings with Mercedes.
A Red Bull team statement said: “We want to warmly thank Sebastian for the incredible role he has played at Infiniti Red Bull Racing for the last six years.”