It depends how you measure... and specifically what you measure. If you are familiar with the mileage signs posted at the terminus points of US 6 and US 20, you might point to those and say, "The answer is plain to see: US 20 is 160 miles longer than US 6."
If both of those signs were accurate, then obviously US 20 would be longer. But the fact is, only one of those signs is accurate, whereas the other significantly overstates the true mileage. I make that statement based on measurements I first took in 2016, and later verified in 2020, using a method that I believe to be quite accurate (and in some cases, more accurate than the "official" distances posted by state departments of transportation). So let's take a look at those mileages:
By my calculations, if one were to travel between Bishop California and Provincetown Massachusetts, strictly following the route of US 6, by the time they completed their journey they would have driven 3205.4 miles. So the US 6 sign shown above (posted near Bishop) is remarkably accurate.
If one were to travel between Newport Oregon and Boston Massachusetts, unwaveringly following the signs for US 20, they would end up driving a total of either 3283.4 miles or 3297.1 miles. (There are two obvious routes through Yellowstone National Park, one of which is 13.7 miles longer than the other, resulting in two mileage figures.)
So you can see that the US 20 sign shown above is overstated by at least 68 miles, and as much as 82 miles. It is no surprise that number is off, because it was sourced from the 1989 AASHTO route log, which was at least 27 years old by the time it was referenced. And more importantly, using that log, the only way to reach a total of 3365 miles is by including the mileage of all bannered routes associated with US 20. So the AASHTO source is definitely not reliable for determining current route mileages.
But even so, US 20 is still the longest, right? Well, not so fast...
We also need to keep in mind that US 20 actually does not exist within the boundaries of Yellowstone National Park. If we subtract Yellowstone mileage from the total above, we end up with 3203.3 miles. So when we compare mileages that are actually defined as US routes, US 6 is 2.1 miles longer than US 20.
Fans of US 20 might be quick to argue, "But to drive across the country on US 20, you have to drive through Yellowstone!" I will grant that... but again, while you are in Yellowstone, you are technically not on US 20.
Lots of internet sources claim that US 20 is the longest US route. That's the "easy" answer, but hopefully this page has demonstrated that the truth is more nuanced than that... and by my own measurements, US 6 is actually longer.
More about the mileage (and midpoint) US 6
More about the mileage (and midpoint) of US 20
Additional research: Mike Roberson