There are a few ways to answer this question, and it largely depends on how you define "longest coastline." If you simply mean the county with the longest shoreline, then that would be San Diego County in California. However, if you take into account factors like the size of the county or the length of its coastline relative to its landmass, then other counties come into play. For example, Marin County in California has a longer coastline per square mile than any other county in the contiguous United States.
When it comes to measuring coastlines, there are two main methods: straight line and tortuous. The former method simply measures the length of a coastline from end to end regardless of any bends or curves. The latter method takes into account every nook and cranny along a shoreline. As you might imagine, these two methods can produce very different results.
For example, using the straight line method, San Diego County has a coastline that stretches for about 120 miles (193 kilometers). But when using the tortuous method, that number jumps up to nearly 500 miles (805 kilometers). So which is correct? Well, it depends on how you want to look at it. If you're interested in raw length alone, then San Diego County is your winner. But if you're interested in seeing which county has more coastline relative to its size, then Marin County is a better choice.