San Jose announced it was teaming up with Waste No Food. The website and app were founded by teenager Kiran Srdihar.
Waste No Food lets businesses and restaurants donate unwanted and leftover food to charities.
"Donors can post excess food in under a minute," Sridhar said. "They can take a picture of the food and then charities in their area will get push notification alerts on their phone that excess food is available and then can claim it."
The app has already been used by San Jose companies to donate $10,000 meals that otherwise would be thrown away.
The need is big in Silicon Valley, where one in four residents does not have enough food to eat.