The direct options
The train runs several times a day and takes about 7 hours with a change in Casablanca or Rabat; it is comfortable and cheap, but the scenery is plains and the day is gone. The CTM and Supratours buses take 8 to 9 hours on the motorway via Beni Mellal. Flying takes an hour in the air and half a day door to door. A private transfer by car is 6 to 7 hours and lets you stop in Beni Mellal and the Middle Atlas.
All of these get you to Fes. None of them shows you anything.
The desert route: three days instead of one
Our 3-day one-way tour from Marrakech to Fes crosses the High Atlas at the Tizi n'Tichka, stops at Ait Ben Haddou, follows the Dades Valley and the Todra Gorges, and reaches Merzouga on the second afternoon for the camel ride into the dunes and the night at the camp. On the third day you drive north through the Ziz Valley, lunch in Midelt, watch the monkeys in the cedar forest of Azrou and arrive at your riad in Fes in the early evening.
For the price of two hotel nights and three days of private driver, you replace a lost travel day with the highlight of most people's Morocco trip. It is the single best decision you can make when planning an itinerary that includes both cities.
Which direction?
Both work. Marrakech to Fes is slightly more common because flights into Marrakech are cheaper and Fes is a calm place to end. Fes to Marrakech ends with the Atlas and the energy of the Red City. If you fly out of Casablanca, Fes is closer (3 hours) than Marrakech (3 hours as well, but with more traffic).
If you really only have one day
Take the morning train, read a book, and plan a day trip to Ait Ben Haddou or the Agafay desert from Marrakech instead so the desert is not entirely absent from your trip.
Tell us your arrival and departure airports and the days you have; we will fit the desert between the two cities so that nothing is wasted.

