The move reunites the Wales player with manager Brendan Rodgers, who left Swansea for Anfield in the close season.
The two clubs had an agreement that Rodgers would not target any of his former Swansea players for 12 months but the Welsh side can agree to any deal in the interests of the club.
"I feel incredible. Everyone knows the history of this club, it's a massive club, and I'm delighted to have joined," 22-year-old Allen told the Liverpool website.
"The passion that people here have for football is something I share and I want to be part of that."
A delighted Rodgers added: "Joe is a player whose profile will fit perfectly with the ideas of this group.
"His ability to control and dominate the ball is an important ingredient in our attempt to gain success on the field."
Allen is the second player Rodgers has brought to Merseyside after Italy striker Fabio Borini arrived from Serie A side Roma.
He has been capped eight times by Wales and represented Britain at the London 2012 Olympic Games.
The Premier League season starts on August 18.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.