Nicholls, 28, will join the club as a free agent on July 1, 2021, having penned a two-year deal, with the club having the option of a further year’s extension.
Nicholls, who has played 250 games in his career, having also formerly played for Wigan Athletic, will compete for first-team duties with Ryan Schofield.
His arrival follows on from the additions of striker Jordan Rhodes and defender Matty Pearson.
Town’s Head of Football Operations Leigh Bromby said: “We wanted to add a senior goalkeeper to the group to ensure we have the right level of competition in that area.
“Lee will arrive at Huddersfield Town with good experience, having played regularly in League 1 and League 2 during three of the last four seasons, and is an excellent character to add to our dressing room.
“His challenge is to push Ryan Schofield for the starting shirt every day in training and to help drive the standard for our young goalkeepers.”
Head of goalkeeping Paul Clements added: “Every year I like to have two goalkeepers that are fiercely challenging for the number one shirt, which is why I’m delighted we’ll bring Lee to Huddersfield Town.
“The biggest thing about him is his hunger to play regularly in the Sky Bet Championship. He’s had loads of experience in League 1 and really wants to test himself at this level. He’s at a good age and is willing to learn to push himself further.
“He’s had a lot of good experiences, he’s a real leader, and I received glowing references from everyone I spoke with.
“Lee will provide an excellent challenge to Ryan for a starting spot and I can’t wait to work with him.”