Edinburgh and York tie for second place in the big city category, while Chester is runner-up in the medium city list and Durham and St Andrews rank joint second in the small city category.
At the other end of the table, Derby is the worst-ranked big city, Bournemouth is last in the medium-sized cities and towns ranking, and Torquay and Fort William are joint bottom in the small cities and towns list.
The results come from a survey of almost 4,000 Which? members, who were asked about their experiences visiting UK cities and towns in the past two years.
Each location is rated out of five stars on a range of criteria, including accommodation, food and drink, cultural sights and tourist attractions, ease of getting around, lack of crowds, and value for money.
The best cities and towns in the UK for a weekend staycation break have been ranked by Which?, with Liverpool named the number one big city to visit.
Bath has been revealed as the highest-ranking medium-sized city in the survey. One visitor described it as 'one of the top sites in the UK, indeed Europe'. Above is the view of the Pulteney Bridge over the River Avon
Wells in Somerset is first in the small city ranking - and the entire survey overall, with the highest percentage score.
The consumer champion calculated an overall city score based on visitors' overall satisfaction and likeliness to recommend.
LARGE CITIES
In the 'large cities and towns' category of the study - defined as those having a population of over 200,000 - Liverpool ranks top with an overall score of 84 per cent.
The 'lively' and 'buzzing' city scores a full five stars in the cultural sights and tourist attractions category, with 'respondents noting an impressive range of cultural and historical attractions beyond The Beatles'.
According to Which?, one respondent said: 'It's got everything you could possibly want. Great for eating places, great for sights and famous places and very friendly people.'
Edinburgh and York tie for second in the big cities list with scores of 83 per cent.
Which? says the 'stunning' Scottish capital is 'bursting with cultural activities according to visitors, who score it a full five stars for cultural sights and tourist attractions'.
Edinburgh receives four stars for food and drink, shopping, ease of getting around, and overall value for money.
Edinburgh is joint second in the large city ranking. Above is the skyline of the city from Calton Hill
York is also second, scoring 83 per cent overall. It takes five stars in the cultural sights and tourist attractions category
Derby comes last (25th) with a score of 56 per cent overall, receiving just two stars in five categories, including accommodation, cultural sights and ease of getting around. Above is the view of the Sadler Gate in the heart of Derby City
York, a city 'known for its Roman and Viking heritage', also takes five stars in the cultural sights and tourist attractions category and scores four stars for shopping, accommodation, ease of getting around, value for money and food and drink.
The rest of the top five comprises fourth-place Belfast (77 per cent) and fifth-place Glasgow (76 per cent).
Derby comes last (25th) with a score of 56 per cent overall, receiving just two stars in five categories, including accommodation, cultural sights and ease of getting around.
Which? says one visitor noted that while 'there are not a huge number of cultural sights within the city centre, the Museum of Making is worth a visit'.
Swansea and Leicester (joint 24th) narrowly miss the worst-city title, both receiving 58 per cent.
MEDIUM CITIES
Moving on to the 'medium cities' ranking, gold medal winner Bath - known for its 'well-preserved Roman baths and the Georgian houses of the Royal Crescent' - has a score of 82 per cent. Receiving five stars for cultural sights and tourist attractions, Which? says one visitor described it as 'one of the top sites in the UK, indeed Europe'.
Second-place Chester scores 80 per cent overall, boasting four stars in all but one category, parking, in which it scores three stars.
THE BEST UK CITIES AND TOWNS FOR A STAYCATION IN 2024, ACCORDING TO WHICH?
Large cities
1. Liverpool - 84 per cent
2. Edinburgh - 83 per cent
3. York - 83 per cent
4. Belfast - 77 per cent
5. Glasgow - 76 per cent
6. London - 76 per cent
7. Newcastle-upon-Tyne - 75 per cent
8. Portsmouth - 74 per cent
9. Bristol - 73 per cent
10. Cardiff - 72 per cent
11. Manchester - 71 per cent
12. Brighton & Hove - 67 per cent
13. Leeds - 67 per cent
14. Hull - 66 per cent
15. Nottingham - 66 per cent
16. Plymouth - 66 per cent
17. Birmingham - 64 per cent
18. Coventry - 63 per cent
19. Sheffield - 63 per cent
20. Milton Keynes - 61 per cent
21. Aberdeen - 60 per cent
22. Southampton - 60 per cent
23. Leicester - 58 per cent
24. Swansea - 58 per cent
25. Derby - 56 per cent
Medium cities
1. Bath - 82 per cent
2. Chester - 80 per cent
3. Lincoln - 78 per cent
4. Worcester - 77 per cent
5. Canterbury - 76 per cent
6. Shrewsbury - 75 per cent
7. Harrogate - 74 per cent
8. Oxford - 74 per cent
9. Norwich - 73 per cent
10. Cambridge - 72 per cent
11. Exeter - 71 per cent
12. Cheltenham - 67 per cent
13. Dundee - 62 per cent
14. Eastbourne - 62 per cent
15. Hastings - 62 per cent
16. Gloucester - 61 per cent
17. Ipswich - 59 per cent
18. Bournemouth - 58 per cent
Small cities
1. Wells - 86 per cent
2. Durham - 78 per cent
3. St Andrews - 78 per cent
4. Winchester - 77 per cent
5. Stratford Upon Avon - 76 per cent
6. Salisbury - 75 per cent
7. Stirling - 75 per cent
8. St David's - 74 per cent
9. St Ives - 74 per cent
10. Ely - 73 per cent
11. Windsor - 73 per cent
12. Chichester - 69 per cent
13. Inverness - 69 per cent
14. Oban - 69 per cent
15. Lancaster - 67 per cent
16. Perth - 65 per cent
17. Truro - 61 per cent
18. Fort William - 58 per cent
19. Torquay - 58 per cent
Source: Which?
Lincoln takes third place with an overall score of 78 per cent. The city scores highly in accommodation, cultural sights, lack of crowds and value for money, receiving four stars in each.
Rounding off the top five is Worcester (fourth), with an overall score of 77 per cent, and Canterbury (fifth) with 76 per cent.
Ipswich finishes second to last with an overall score of 59 per cent, while last-place Bournemouth has a score of 58 per cent, with the city earning just one star for parking.
SMALL TOWNS AND CITIES
In the 'small cities and towns' category, first-place Wells has a score of 86 per cent. The Somerset town is also the highest-scoring location in the survey overall.
It receives four stars for its range of cultural sights and tourist attractions. According to the consumer group, these 'include the Cathedral, Bishop's Palace and Vicar's Close'.
Durham and St Andrews come joint second with scores of 78 per cent.
In joint second place in the small cities and towns list is Durham.
St Andrews, a seaside town in Scotland , also ranks second, with a score of 78 per cent
Durham, located south of Newcastle upon Tyne, was awarded four stars for accommodation, cultural sights, lack of crowds and value for money. While St Andrews scores four stars for accommodation and lack of crowds.
Winchester (77 per cent) and Stratford-upon-Avon (76 per cent) complete the rest of the top five.
Meanwhile, joint-last Fort William and Torquay receive scores of 58 per cent. Fort William scores poorly for food and drink, accommodation, shopping and ease of getting around, receiving two stars in each category, while Torquay scores worst for parking, with one star.
Commenting on the survey's findings, Rory Boland, Editor of Which? Travel, said: 'Whether you're after vibrant nightlife, world-class museums or a first-rate dining experience, our survey shows that the UK has a wealth of fantastic cities just waiting to be explored.
'Liverpool stood out among the UK's large cities for its fantastic cultural scene and buzzing atmosphere, beating London and the UK's other capital cities to take first place.
'For those seeking a more laid-back destination, Somerset is the place to be, with both Bath and Wells scoring highly, and each offering a wealth of historical and cultural sights.'