"The timing's right. I made the decision, got to 100% about a month ago. I wasn't sure how the last few weeks would go, how I'd find things, but it's actually been a good spell really. I've enjoyed it."
The Swans host Oxford United in their final match of the Championship season, which will also be the last game of Allen's career.
"I've had a chance to reflect and take it all in. I'm really looking forward to what's going to be my last game on Saturday," he added.
"I'm very proud. I didn't think I'd be sat here playing as many games as I have for clubs I have done at that level and for Wales as well.
"I've been incredibly fortunate and as I've reflected over the last few weeks very grateful and thankful to everyone who has has helped me on my way to have these amazing experiences."
Allen's retirement is likely to come as a disappointment to Wales head coach Craig Bellamy, who brought the Pembrokeshire-born player out of international retirement after taking charge last year.
Allen had originally halted his Wales career in February 2023, in the wake of the 2022 World Cup.
Wales ended a 64-year wait to play at the World Cup in Qatar, but the tournament was a disappointment for Robert Page's side as they went out at the group stage.
Allen started Wales' final game in the competition, against England, having returned after a long-term injury lay-off in their second group match against Iran.
There were happier times at Euro 2020, when Wales reached the second round, and most memorably at the 2016 European Championship.