Theresa May will be joined in the city by the Earl of Wessex, representing the Queen, and Defence Secretary Sir Michael Fallon.
The ninth annual Armed Forces Day will see regulars, reservists, their families and veterans gather in the city for a parade, displays, a ship visit and Red Arrows and Typhoon flypasts.
More than 300 other events will take place around the world as part of the celebrations.
Mrs May said: "In the aftermath of the Manchester attack, military personnel played a vital role on UK streets, providing visible reassurance to our communities.
"And further afield they continue to take the fight to Daesh (Islamic State) in Iraq and Syria, helping to drive the terrorists back and give ordinary people in those countries the chance to rebuild their lives.
"I am proud to be attending the Armed Forces Day celebrations in the great city of Liverpool this year, joining thousands of people in expressing our gratitude to the men and women who do so much to preserve our freedom."
Sir Michael added: "We owe a huge gratitude to the men and women of our Armed Forces and salute their service in keeping us safe each and every day.
"As we celebrate Armed Forces Day there are 10,000 regulars and reserve personnel serving now on NATO operations.
"There are Royal Navy ships serving in the Gulf, the British Army is supporting UN peacekeeping in South Sudan, and the Royal Air Force are patrolling the skies above the Black Sea region in the campaign against Daesh terrorism and on NATO deployments; the Royal Navy is helping protect the Gulf; the Army is peace-keeping in South Sudan and Somalia; and the Royal Air Force is patrolling the skies above the Black Sea."