The 31-year-old Swiss, due to ride for RadioShack in Stage 11 on Thursday, said the decision was hard to make but ultimately put family before competition.
"I am not only a bike rider, I am also a husband and father with another baby on the way," Cancellara said in a statement.
"It is my personal wish to be present when my wife Stefanie gives birth to our second child.
"That 'trophy' is more important than another Tour stage win or an Olympic medal.
"I already need to thank my wife for her patience with me during the last month in her pregnancy that has been difficult at times. The least I can do is to assist her in these difficult days."
His team mates and directors have backed him, Cancellara said.
"The atmosphere within this group is amazing," he said.
"All of this makes it hard to abandon here. On the other hand, all of my team-mates and directors understand and agree with my decision."
He will now fly back to his wife in Bern and will resume competition at the London Olympics where he looks to defend the road race time trial gold medal he won in Beijing in 2008.