Khedira, 34, began his career at VfB Stuttgart and helped them win the league title in the 2006-07 season before moving to Real Madrid, where he won the league and Champions League in a trophy-laden spell.
Khedira went on to win five Serie A titles at Juventus after joining them in 2015 and left for Hertha three months ago, playing eight games for the team as they avoided relegation.
"After the match on Saturday it's time to say goodbye," Khedira said on Twitter. "So proud that I had the chance to experience all these special moments with you. Thanks to all the fans, team mates, coaches and of course my family and friends."
Khedira played 77 games for Germany scoring seven goals and helped them win the 2014 World Cup in Brazil.
"It's a pretty tough step and it's hard for me to talk about, but it's the right decision," Khedira said of his decision to retire at a news conference on Wednesday.
"Fifteen years in professional soccer have left their mark and I have to honestly judge what I can and cannot do. And at the end of the day, gratitude outweighs everything that I was able to experience."