The Blackhawks have seven days to match or they will lose Hjalmarsson and receive a first-round and third-round pick in return.
"Teams realize Chicago's position with the salary cap, and Niklas is a good, young player on the rise," Hjalmarsson's agent, Kevin Epp, said.
The 23-year-old Hjalmarsson would help replace captain Rob Blake, who announced his retirement at age 40 last month. The Sharks were looking for a defenseman on the market and found one from one of their key competitors in the Western Conference.
"We feel Niklas is a top-three defenseman in the National Hockey League," general manager Doug Wilson said. "We saw his abilities firsthand in the playoffs last season and he was an important piece of a Stanley Cup-winning team. He is a solid player that would be a good fit on our team now and in the future."
Hjalmarsson helped Chicago sweep the Sharks in the Western Conference final last season and then beat Philadelphia to win the Stanley Cup. He had a goal and seven assists in the postseason, including two assists against the Sharks.
He was third on the team with a plus-9 rating in the playoffs, while averaging more than 21 minutes of ice time per game.
The Blackhawks were facing salary-cap problems after winning the Cup, and already have lost defenseman Brent Sopel and key forwards Dustin Byfuglien, Kris Versteeg and Andrew Ladd this offseason. They now have a decision to make on Hjalmarsson.
He had two goals and 15 assists in 77 regular-season games. This was his first full season in the NHL, after he played sparingly for the Blackhawks the previous two years. He has three goals and 18 assists in 111 career games.
If Hjalmarsson does join the Sharks, he would be the second key addition in free agency this offseason, following last week's signing of goalie Antero Niittymaki.
San Jose also has kept free agents Patrick Marleau, Joe Pavelski, Niclas Wallin, Scott Nichol and Jay Leach, while losing Blake to retirement, forward Manny Malhotra to Vancouver, and allowing goalie Evgeni Nabokov to leave. Nabokov signed with a Russian team this week.
The Sharks are still trying to reach a deal with restricted free-agent forward Devin Setoguchi.
ESPNChicago.com's Jesse Rogers and The Associated Press contributed to this report.