Langer, 36, will join leg spinner Shane Warne and Glenn McGrath in making his final Test appearance this week after helping Australia successfully regain the Ashes.
"It was obviously a tough decision .... but I know in my heart it's the right thing to so," Langer told a news conference at the Sydney Cricket Ground on Monday.
"They say 'go out on your terms and on top of your game' and I think I'm doing that."
Langer is one of Australia's greatest top-order batsmen. Originally a number three, he moved to opener in 2001 and played 104 Tests, scoring 7,650 runs including 23 centuries at an average of 45.26.
The left-hander also formed a hugely successful opening partnership with Matthew Hayden, which ranks as the best in Australian history and featured six double-century stands.
"This is an emotional time for me ... there hasn't been a moment in the last 20 years when I haven't thought about Test cricket so it's a hard decision," he said.
"I've played in an incredible team so I retire from this game having played with some of the greatest players of all time.
"I'm very proud of the partnership I've formed with Matthew Hayden and the friendships I've made with all the other players."
Agonised: Langer said he had agonised for months about retiring as speculation began to increase that Australia's all-conquering team were about to finish up en masse if they won the Ashes.
His Western Australian team mate Damien Martyn quit after the second Test in Adelaide then Warne and McGrath announced their retirements before the fourth Test in Melbourne.
"I love cricket and that's why it's so hard for me to retire," an emotional Langer said.
"I've been fighting this for a long time and to give up the chance to wear the baggy green time again is a difficult thing."
Langer said he would miss the competition of going up against great players but added that he would now be able to spend more time with his family.
Langer said he would continue playing first-class cricket for at least another year, with Western Australia then Somerset in England, but quitting Test cricket was the hardest decision he had to make.
"I feel sad about it but I know in the heart it's the right thing to do."