The direct distance, as the crow flies, from Nazareth to Bethlehem is about 70 miles. Mary and Joseph probably walked more than 90 miles before they reached their resting place at the stable.
Mary and Joseph were compelled to make the long journey to Bethlehem after a census was proclaimed by Caesar Augustus, the Roman emperor. Joseph hailed from Bethlehem in Judea, and the decree required citizens to register at their birthplaces.
The shortest route to Bethlehem was directly south through Samaria, but its hilly terrain would have proven particularly arduous for Mary, who was in the late stages of pregnancy. Other factors in avoiding that route were the hostile Samaritans in the region, who could have posed a threat to the two travelers, and the knowledge that it would be difficult for them to find lodgings.
It's believed that Mary and Joseph chose a safer and more comfortable route that took them southeast through the Jezreel Valley and further east to the Jordan Valley. Continuing south to Jericho, they probably proceeded up through the Judean Desert to Jerusalem and onward to Bethlehem. By the end of their difficult trek, the couple would have walked more than 90 miles; much of that distance across difficult terrain.
Opinions differ on how many days it took Mary and Joseph to complete their epic journey from Nazareth to Bethlehem. Some scholars believe the trek lasted from 4 to 7 days, while the Institute for Priestly Formation cites the journey as lasting a week and a half.