Williams, 22, who spent three months on loan at Glanford Park last season, has joined for an undisclosed fee and has signed a three-year deal.
“It’s brilliant to have signed. I couldn’t be happier,” he told the club’s official website.
“I came in on Wednesday and undertook my medical, and saw all the familiar faces from when I was here before.
“Everyone is raring to get going.”
Williams, who progressed through Middlesbrough’s academy, made six appearances for the Iron last season during a three-month loan spell from October, scoring twice.
He has also had loan spells at Hartlepool, Coventry and Peterborough.