I spend 3 weeks in Vietnam with 2 main spots are Hanoi and Ho Chi Minh city. However, I think it’s possible to shorten it to 2 weeks. I really enjoyed immersing myself in their culture.
My recommended route is
Arrive in Hanoi and spend 2 days here wandering around the Old Quarter, French Quarter and Ho Chi Minh Mausoleum. Don’t forget to try out Hanoi street food
Book a 2 days cruise tour in Halong Bay: 2 days onboard will be most ideal since a day trip there is rush as the transferring time between places are around 4 hours each way. Overnight bus to Hue and 2 days there.
Bus to Da Nang, a beautiful city with many attractions. Hoi An, a short ride outside of the city, is worth a day tour. 3 days in total is enjoyable.
Overnight bus to Nha Trang with 2 days for beaches and islands day tour.
Head to Da Lat by bus. This is my favorite place with cool, green and pretty. waterfalls and hill tribes. I spent 2 days there and really enjoyed it.
Bus to Ho Chi Minh City and had 2 nice days exploring the city before departure
That will take right at 15 days. You have overnight bus option to save one night's accommodation and that you don't miss any day traveling. Always prefer the overnight bus.
Also, stay as long as you can. Stay a few extra days is definitely better. Vietnam has heaps of places you should explore. Sapa and Ninh Binh in the north; Mui Ne and Mekong Delta in the south and much to discover. I don't think you'll regret stretching your itinerary a little bit!