Macheda has struggled to make an impact at Old Trafford after scoring a famous debut goal against Aston Villa as a 17-year-old that helped secure the Premier League title in 2009.
Loan spells at Sampdoria and QPR have both proved disappointing, and now the Italian is looking to kick-start his career in Germany after passing a medical.
"I have followed the Bundesliga and of course I know Stuttgart," said Macheda on his new club's website.
"I'm delighted to be able to play for them now. I now have got to get to know my team-mates and settle in, because we have got many interesting games in three competitions to come."
Stuttgart's director of sport Fredi Bobic, who successfully completed negotiations with United on Thursday, added: "We wanted a striker and we are pleased that we have found one now in Federico Macheda.
"Federico is young and hungry for success and he therefore fits in very well in Stuttgart.
"He comes from a top European club and has already proven himself there. We now want to integrate him as quickly as possible into the team."
Macheda is available to Stuttgart coach Bruno Labbadia immediately and could make his debut against Bayern Munich on Sunday, although with Vedad Ibisevic back from suspension, he may have to make do with a watching brief as he settles into his new environment.
The Italian striker will wear the number 14 shirt for the Bundesliga club.
- Sports & Recreation