The Bradford-born left-back has agreed a deal which will keep him at the Utilita Energy Stadium until at least the summer of 2024 - with the option of a further year - after his agreement was set to expire in June.
Foulds made 28 appearances for the Bantams last season, scoring two goals including his first in professional football against Harrogate Town in February.
The former Everton academy prospect began as a youngster at the Utilita Energy Stadium, before moving to Bury and Como in Italy.
Foulds said: “I am delighted to be here for at least the next two years. It is a real push in the right direction for me, personally.
“I have been sat in the sands at Valley Parade as a kid, so there is no better feeling than playing in front of 18,000 supporters.
“I played over 20 games last season which is the most I have got out of any season, but I think we underachieved.
“Next year, with the plans we have as a football club, we want to have a real good go. We want to get the place going again next season.”
City manager Mark Hughes said: “We are pleased to have Matty with us for at least the next two years, and are looking forward to continuing to work with him.
“He has had a strong season with us, and typifies the kind of character we want at this football club.
“Matty wears his heart on his sleeve, loves Bradford City and always gives 110% on the field.
“At 24, he is still at a great age to develop, and we are happy he sees his long-term future here with us.”