Shaw, 22, was set to become a restricted free agent after this season. His new contract, which a source tells ESPN.com is for $2 million a season, runs through 2015-16.
Shaw was happy to get the deal done during the regular season.
"It's always in the back of your head," Shaw said. "It's nice to clear the air and now I can just focus on improving my game."
Shaw, who has been a mainstay on the Blackhawks' third line, has four goals, seven assists and 51 hits in 18 games this season.
He had five goals and four assists in helping the Blackhawks to the Stanley Cup last season. He has 25 goals and 24 assists in 103 career regular-season games.
"It's great to come to this agreement with Andrew and keep another important member of our team here in Chicago" general manager Stan Bowman said in a statement. "Andrew has proven his ability to play a prominent role on our team and we look forward to watching him continue to grow as a player for the Blackhawks."
Shaw was drafted by the Blackhawks in the fifth round in 2011.
ESPN.com NHL reporter Pierre LeBrun contributed to this report.