The first thing you do after signing up for a marathon (besides question your sanity) is find a training plan. And when you pick your training plan, the only thing scarier than knowing you’ll run 26.2 at the end of it is realizing that you’ll have to run nearly that far at least once before race day. Yikes.

Most marathon training plans call for a 20-mile run four weeks before the race. When I trained for my first marathon, my running coach told me to try and hit 23 miles if I could—her point being that not knowing what those last 3 miles will feel like is a whole lot better than not knowing what the last 6 miles will feel like. But while training for my second marathon, my longest run clocked in at just 18 miles, thanks to knee pain from overtraining (whoops). On both race days, I was thrilled with my performance (I finished!) and even scored PRs.

Why 20 miles, then? “Scientifically, there is absolutely no reason why you should run exactly 20,” says Elizabeth Corkum, a USATF-certified running coach and senior instructor at Mile High Run Club in New York City. “Mentally, training to the 20-mile mark can give a runner confidence when heading toward marathon day; physically, it also helps simulate the late miles in the marathon.”

If 20 isn’t the magic number, then how far should you run? Well, it really depends on your goal…

If you’re a first-time marathoner or you just want to finish…

But you’d probably do better focusing less on mileage and more on time during your long runs. “The purpose of the long runs is time on one’s feet,” Corkum says. “For example, at my long-run pace, a 20-miler will take about 2.5 hours. For someone else, that could take 4 hours. Those are two completely different levels of stress on the body!”

Running coach John Honerkamp recommends capping long runs at 3.5 hours. “A 20-mile run is more mental than physical,” he says. “In most cases, there is no benefit to running more than 20 miles before race day, and there can be significant risks of overuse issues or injury.”

That said, you don’t want to run less than 16 miles or less than 3 hours, whichever comes first. “You want to get your body used to being tired and then asking it to run more,” Honerkamp says. “You’re callusing your mind and body to push when it doesn’t want it.”

And don’t freak out if injury, a tight schedule, a slower pace, or other really intense workouts during the week are cutting into your long-run distances. Instead, “focus on even pacing for your biggest long runs, fueling on your feet, and simply trusting your training,” Corkum says.

If you’re trying to beat your last marathon time…

Once you know what 26.2 miles feels like, long runs become less about boosting confidence and more about just putting in the work. But the same rule still applies: Keep your run under 3.5 hours.

Faster runners, though, can cover a lot more distance in 3.5 hours. This is where your goal time comes into play: If the average marathon finisher runs a 10-minute mile, their longest run should be 21 miles. Someone racing 8-minute miles could literally finish a marathon in 3.5 hours. Honerkamp recommends PR-chasers cap their long runs at 20 to 22 miles. “This increases their chances of staying healthy,” he says.

Instead of trying to get close to the full marathon distance, Honerkamp suggests focusing on different types of quality work. “You should run hard one to two times a week, and running hard is intervals, hills, tempo, and speed work,” he says. “The easiest way to get faster is by running faster—and that goes for any race distance,” he says.

But remember, long runs are practice. “Many runners get caught up in the numbers and often burn out or peak before marathon day,” Corkum says. Whatever the mental boost, “it’s not worth hammering out a 23-miler a few weeks before the marathon if you get to the starting line beat up from that epic long run.”

The Bottom Line

There’s no one-size-fits-all marathon training plan, and you know your body better than anyone else. If you feel like you need to hit 20 or more before race day, and you’re healthy and can get it done with enough time to recover, go for it. If you want to protect your legs and be more conservative about your mileage, that’s fine too. Long runs are crucial to marathon training, but it’s not about an exact number. The most important thing is that you do all the prep work—running, regular strength training, and recovery work like yoga and foam rolling.

“It’s tempting for marathoners to compare themselves to others,” Corkum warns. “When a runner starts rambling about their training achievements, it can make someone question themselves and their dedication. There are a dozen ways to get to the starting line. What’s important is what’s right for that individual. Be your best when it counts: on race day.”