Federer, who is currently at five in the world, his lowest ranking for a decade, gave no reason for his withdrawal.
“I am disappointed not to be playing in Montreal next week. It is a great tournament with amazing fans. I look forward to competing there in the future,” he wrote on his Facebook page.
The 17-time Grand Slam title winner was beaten in the first round at Gstaad last week by Germany’s Daniel Brands and admitted he had been suffering from back pain.
“I’ve had serious problems with the back, I had to get some anti-inflammatories last week in Hamburg due to the pain,” he said after his loss in Switzerland.
His defeat to Brands was his third of the summer against an opponent ranked outside the top 50.
He was beaten in the Wimbledon second round by Sergiy Stakhovsky and then lost in the Hamburg semifinals to Argentine qualifier Federico Delbonis.
Federer has won only the Halle title this season after claiming his 17th Grand Slam title at Wimbledon in 2012.
His defeat to Ukraine’s world number 116 Stakhovsky in the second round at Wimbledon brought to an end a run of 36 consecutive Grand Slam quarterfinal appearances.