The Ivorian defender has become a crucial member of Sam Allardyce's defence since arriving from Hamburg in 2011 and has been rewarded with the contract.
Demel, who has appeared 17 times this season, is set to celebrate the news by facing former club Arsenal on Wednesday night.
"It's really good for me and I'm really happy to have a new deal with West Ham," he said.
"I've had a good year this season, and even last year was good, despite the fact that I was injured for so long and struggled a bit.
"I'm happy to be at West Ham and in the team. The lads are really good with me as are the people working for the club. I hope I will stay that long to play in the new stadium as well."