Sobhi agreed a three-year contract with the Premier League club and will join up with his new team-mates after Egypt's World Cup campaign.
The 21-year-old made 41 appearances for Stoke after joining from Al Ahly in July 2016, but was unable to stop the Potters being relegated from the Premier League this season.
Sobhi flew in from Egypt's training camp to seal his switch before resuming his preparations for the World Cup in Russia.
Egypt face Uruguay in their opening Group A fixture on Friday and also play Russia and Saudi Arabia in the first round.
"He's a real talent and has achieved a lot for a player who is only 21 years old, playing over 20 times for his country ahead of this summer's World Cup," Huddersfield boss David Wagner said.
"Just as Jonas Lossl, Elias Kachunga and Laurent Depoitre did, Ramadan will join our club on the back of a challenging season.
"However, he already has a lot of the qualities that we look for in our 'Terriers Identity'; he's skilful, direct and very quick-thinking.
"He still has a lot of space to improve too, which is very exciting."