Foster was without a club after leaving Watford in the summer following their relegation from the Premier League.
The 39-year-old also played for the likes of West Bromwich Albion and Birmingham City during a career which saw him make 519 appearances.
Foster won eight caps for the England national team, including one appearance at the 2014 FIFA World Cup in Brazil.
Newcastle made an offer for Foster recently after reserve goalkeeper Karl Darlow was ruled out for the rest of the year through injury, but the offer was declined for family reasons.
Speaking on his podcast, The Cycling GK, Foster said: "I've got an announcement to make, it's a big one. The time has finally come for me to announce my retirement."
Deep down I didn't want to do it [turn down Newcastle].
"It sounds mad and it's such a hard thing to explain because there'll be millions of people up and down the country that will say 'you've just been offered a contract, a really good contract, by the richest team in the world to go and be second-choice goalkeeper and be part of something'.
"But I just didn't want to do it, I had this deep feeling, and the wrench of it was that I'd have to move away from home, that would kill me.
"If I'm in an apartment in Newcastle by myself, away from my family, I don't think people can understand. That's hard to do, especially at the age I am and with everything else I've got going on.
"I know for a fact if I'd have gone there I'd have had an amazing time, the lads would have been absolutely brilliant and I'd have buzzed off the stadium, the fans, all that kind of stuff, but the overriding sinking feeling was 'I don't want to do this.'"
Foster won three League Cups during his career; two with Manchester United and one with Birmingham City.