O’Neil made 22 appearances in League One last season while on loan at the Iron, including appearing against the Spireites at Glanford Park.
Spireites manager Dean Saunders said: “Liam is a young player who has played in West Brom’s first team. He’s exactly what we want – a midfield player who can also play at the back, if required.
“He’s one for the future for us, having been tracked by the club for two-and-a-half years. We were going to loan him but we’ve managed to sign him permanently, which is great for the long-term future of the club.”
The length of the contract signed by O’Neil has not been disclosed.