Hannan played 16 seasons in the league, spending parts of 11 as a member of the Sharks. He went unsigned as a free agent this season.
"I was extremely fortunate to play in the NHL with five great organizations," Hannan said in a release. "I'd like to thank all of my teammates and coaches over the years who have contributed so much to my career. It's also very gratifying to end my NHL career where it started - with the San Jose Sharks.
"I'd be remiss for not also thanking Bruce Hamilton and Lorne Frey with the Kelowna Rockets for putting me on the path to have a chance to play in the NHL. Most importantly, I want to thank all of my family, particularly my wife Kristina and my boys, Gage and Owen. Their sacrifices have allowed me the opportunity to follow this dream of playing in the National Hockey League."
The 37-year-old sits sixth on the Sharks' all-time games played list with 626, and is one of only six Sharks to suit up in more than 600 games with the franchise.
After being drafted by the team in the first round in 1997, Hannan spent his first six seasons in San Jose before stints with the Colorado Avalanche, Washington Capitals, Calgary Flames, and Nashville Predators.
Hannan returned to the Sharks for his final three seasons.
He concludes his career with 38 goals and 217 points in 1,055 games played.