Growing up in a small town, Hansen swam for many different clubs including Karakung Swim Club and Suburban Seahawks Club. He is well known for his unique style of breaststroke, which incorporates a kick that is much narrower than other swimmers. Hansen attended the University of Texas to be a part of the UT Longhorns Swim Team. In his first season, he won four NCAA titles and four NCAA All-American honors. He completed his collegiate career with a total thirteen NCAA titles and Big 12 Conference Swimmer of the Year.