The 30-year-old's contract with Leicester expires at the end of the month, giving Huddersfield the opportunity to boost their options in goal.
Hamer made four Premier League appearances in 2017-18 but has struggled to displace Kasper Schmeichel in his time at the King Power Stadium.
The goalkeeper signs on a three-year deal with the club holding an option for a fourth year.
Hamer appeared just nine times for the Foxes last year but should provide competition for Huddersfield starter Jonas Lossl.
"Ben's arrival adds more quality to our already strong goalkeeping department under Paul Clements," said manager David Wagner to the club's website.
"I've spoken with Ben and he arrives here wanting to play Premier League football, which is great for us all," .
"Jonas Lossl had a fantastic first season at the club and this further competition will bring even more out of everyone, which is ideal for me and the team."
Hamer marks the first signing of the summer for Wagner, with the club having finished 16th in the league last season.