The 21-year-old joins following a successful trial spell at Glanford Park.
Dewhurst has represented England at under 17, 18, 19 and 20 levels and made three appearances on loan at National League outfit Solihull Moors early last season.
Previously, he also spent time on loan at Guiseley in 2019, where he appeared over 40 times in the National League North. He also made two appearances on loan at Carlisle United of League Two in 2020.
Last season he was mainly on loan at Boston United in the National League North, and made 35 appearances, reaching the play-off final for that division.
"He's a good goalkeeper and offers the qualities I'm looking," first team manager Keith Hill told Iron Player.
"He's young and we're going to give him a platform to establish himself. He comes in to fight for the No 1 shirt with Fozzy (Owen Foster), who is an excellent young goalkeeper.
"We've been really impressed with him while he's been training with us for the last couple of weeks. A key component for me is distribution and his relationship with the back four - that's something we've been working on. He'll get better and better with experience, and we're going to give him that.
"I'm really thankful to Sheffield United and to Marcus too for taking on the challenges we have at the football club, and we're really determined to be successful."
The transfer is subject to league and FA ratification.