The 31-year-old, Fulham's top scorer in 2013-14, will join the Potters on a two-year deal on 1 July.
"Steve was much in demand and we are delighted to have won the race to secure his signature," said Stoke chief executive Tony Scholes.
I'm sure he will prove to be an excellent addition
The former Chelsea player is the club's second signing of the summer following the capture of Phil Bardsley.
They are "hopeful" of landing ex-Manchester United striker Mame Biram Diouf from Hannover 96 as Mark Hughes seeks to strengthen a squad that achieved the club's record Premier League points tally last season.
Hughes signed Sidwell, who has made more than 180 appearances in the Premier League, while working as Fulham manager in 2011.
The former Arsenal trainee played in all 38 of the Cottagers' top-flight fixtures in 2013-14, scoring seven goals.
"Like Phil Bardsley, Steve brings great experience to our squad and I'm sure he will prove to be an excellent addition to our squad," said Scholes.
Sidwell, who has also played for Reading and Aston Villa, wrote on Twitter he was "saddened" his time at Craven Cottage had ended.
Stoke City have signed midfielder Steve Sidwell on a free transfer following his release by relegated Fulham.