The 39-year-old left Watford at the end of last season and was capped eight times by England having joined Manchester United from Stoke as a youngster.
He made 23 appearances for the Red Devils, winning the League Cup twice after impressing on successive loan spells at Watford.
Foster went on to play for Birmingham and West Brom and returned to Vicarage Road in 2018.
He announced his retirement on his YouTube channel, also revealing he turned down a move to Newcastle last week before making the decision.
"Welcome back to a very special edition of the FozCast because today I've got an announcement to make - it is a big one," he said on his Cycling GK series.
"The time has finally come for me to announce my retirement. I have got a belting story for you and it will explain my reasons why I know finally that it is time to hang the gloves up and enter retirement."
Foster then explained how he had been approached by Newcastle after Karl Darlow had suffered an injury but that "deep down I didn't want to do it" as contract talks progressed.
He revealed an agreement was reached and a medical was booked, adding: "I was just eating my dinner and I thought 'no, I'm not doing it'," as the idea of living away from his family turned him off the move.
"I've got to be happy and comfortable and I wouldn't be able to do that so far away from my family. It would kill me."