Both players were set to become unrestricted free agents July 1. Oduya's deal is worth $3.375 million in annual average salary, a source told ESPN.com's Pierre LeBrun, and Mayer's deal is for $650,000.
Oduya, 30, was a trade deadline pickup from the Winnipeg Jets this past season. He played in 18 regular-season games and six playoff games against the Phoenix Coyotes, registering a total of eight points and a plus-4.
"He played a big role in the turnaround of our team down the stretch and it was pretty evident early on his style of hockey complemented our style," said Blackhawks general manager Stan Bowman. "He made our players better."
Oduya was happy to get a deal done so soon.
"For me, it wasn't too much to think about," Oduya said. "I had a good time last year even if it ended a little bit quicker than I wanted to."
Mayers, 37, played in 81 regular-season games and three playoff games, totaling six goals, nine assists and 11 fighting majors. He was a healthy scratch for the final three playoff games against the Coyotes.
"Once you take a step back and you take a look at the whole year, I thought it was a good fit, both for myself and the Hawks," Mayers said. "You try to look at the whole season and not just how things ended."
Oduya is coming off a three-year contract with an annual salary-cap hit of $3.5 million.
The Blackhawks also agreed to terms with forward Joakim Nordstrom, defenseman Klas Dahlbeck, and goaltenders Mac Carruth and Kent Simpson on three-year contracts.
Bowman also said he expects star forward Marian Hossa and defenseman Steve Montador, both of whom suffered concussions, to be ready by training camp in September. Hossa was hurt in the playoffs by a hard hit delivered by the Coyotes' Raffi Torres.
"They're on the road to recovery," Bowman said. "We're certainly optimistic come September they'll be ready to play. ... We're sitting here in May, so it's hard to predict that."
Information from The Associated Press was used in this report.