The 31-year-old attacker, who had a year remaining on his contract, has opted to join former Spireites manager Paul Cook on the south coast.
Roberts was instrumental in Chesterfield’s unsuccessful play-off campaign in League One last season and his departure comes as another huge loss on the same day midfielder Jimmy Ryan rejected the offer of a new contract and joined Fleetwood on a free transfer.
Cook left Chesterfield after Portsmouth agreed compensation in the immediate aftermath their play-off semi-final defeat to Preston in May.
Roberts is an experienced professional who joins his seventh league club. He played in the Welsh league for Rhyl and Bangor before spells with Accrington Stanley and then Ipswich Town.
Roberts spent four years at Huddersfield Town before a stand-out season under Paolo Di Canio at Swindon.
He signed for Chesterfield in 2013 and made 74 league appearances as they were promoted from League Two last season and enjoyed a successful first term in League One under Cook.
Dean Saunders is now the current manager at Chesterfield.