“You do regret your mistakes, you don’t forget your failures,” he said.
“Oh, what I would give to go back to Election Day 2016 and turn that sausage in bread around the right way.”
Shorten said he has experienced “extraordinary highs” and some “painful lows”.
Among them was his failed bid to become prime minister in 2019.
“Political life can be tough. Election defeat, scandal, illness, Section 44…” he said.
“So today, I stand here neither defeated nor disposed, lucky to have served, fortunate to be able to say goodbye and thank you.”
Shorten thanked his wife Chloe and his three children Rupert, Gigi and Clementine during his farewell address.
He then got up to kiss Chloe, who was in the audience during the speech.
Opposition Leader Peter Dutton praised Shorten and said his retirement is a “huge loss to the Australian Labor Party”.
Bill Shorten: The man who was almost prime minister
Shorten received a loud standing ovation from members of parliament at the conclusion of his speech.
The NDIS minister will be stepping back in February after serving in his electorate since 2007.
Shorten revealed in September he had accepted a role as vice-chancellor of the University of Canberra.