Ertz, who played as defender and in midfield during her international career, was a key figure in the United States’ winning World Cup campaigns in 2015 and 2019.
She returned to compete in Australia and New Zealand after a 18-month absence from the pitch, during which time she gave birth to her son Madden.
But the four-times champions suffered their earliest exit in the tournament as they were knocked out in the round of 16.
“Over the past couple of months my heart has been filled with gratitude as I’ve thought about the amazing experiences soccer has given me,” Ertz said in a statement.
“I can walk away with no regrets because while I gave soccer every ounce of myself, soccer gave me even more, and for that I’ll always be thankful.”
Ertz, who joined National Women’s Soccer League (NWSL) side Angel City FC this year, recovered from major knee injury to compete in the 2020 Tokyo Olympics, which were held in 2021, and helped the United States to win the bronze medal.
(Reporting by Amy Tennery in New York, editing by Ed Osmond)