Budapest is a significantly larger city than Prague with roughly 1.7 million inhabitants over 1.2 million. Prague feels like a very compact city where most important sights are within a very short distance. That makes Prague the perfect city to explore on foot.