The multi-division world champion, who is a senator in his native Philippines, has already announced his intention to run for president in the country's 2022 elections.
The 42-year-old's final fight was a defeat by Cuba's Yordenis Ugas in Las Vegas last month.
"I just heard the final bell. Boxing is over," said Pacquiao.
In a video posted on social media, Pacquiao described retiring as the "hardest decision" of his life, adding boxing had given him "the chance to fight my way out of poverty" and "the courage to change more lives".
He also thanked his fans, friends and all those who supported him throughout his career, most notably long-time trainer Freddie Roach, who he described as "my family, a brother and a friend".
"I will never forget what I have done and accomplished in my life," he said.
After growing up in poverty in the south of the Philippines, Pacquiao moved to the capital Manila as a teenager to start a boxing career that would make him one of the world's most highly paid athletes.
He won his first major title in 1998 at the age of 19, defeating Thailand's Chatchai Sasakul for the WBC flyweight title.
Within three years he was fighting in Las Vegas, beating South Africa's Lehlohonolo Ledwaba for the IBF super bantamweight title at the MGM Grand, the venue for most of his fights in the following two decades.
He is now regarded as one of the greatest professional boxers of all time, winning 12 different titles across eight weight divisions and is the only boxer to hold world championships across four decades.
In July 2019, Pacquiao became the oldest welterweight world champion in history at the age of 40 when he defeated Keith Thurman to win the WBA (Super) welterweight title, though he was stripped of the title in January 2021 because of inactivity.
Speaking after his defeat to Ugas in August, Pacquiao said he was "60-40" in favour of quitting.
He retires with a record of 62 wins, eight defeats and two draws.
Pacquiao entered politics in 2010 when he won a seat in the lower house of the Philippines congress, before being elected for a six-year term in the upper chamber in 2016.
He confirmed earlier this month his intention to run for president after he was nominated as a candidate by a faction of the ruling party, PDP-Laban.