O'Neil, who can also play in defence, made two League Cup appearances for the Baggies last season.
The 22-year-old also had a loan spell with Scunthorpe United, scoring two goals in 22 League One games.
"He's exactly what we want - a midfield player who can also play at the back, if required," Chesterfield manager Dean Saunders told the club's website.
"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."
Details of the length of O'Neil's contract have not been disclosed.