Marin County is a county located in the northwestern part of the San Francisco Bay Area of the U.S. state of California. As of the 2020 census, the population was 262,231. Its county seat and largest city is San Rafael.