San Francisco experiences foggy weather, particularly in summer, as the hot air in California’s Central Valley rises upwards, creating a low pressure region that causes the cooler moist air sitting over the surface of the Pacific Ocean to be sucked inland.
The air over the Pacific Ocean is laden with moisture which condenses into water droplets as it moves over cooler areas of sea along the northern California coastline, essentially forming very low cloud or fog. The fog, known as advection fog, tends to peak in July and August when the inland valley temperature is at its highest, and movement of sea currents along the California coast cause cold water from the depths of the ocean to rise to the surface leading to further cooling of the air layer above the sea.
San Francisco is particularly prone to fog because of its location by the ocean at the entrance to the Golden Gate Strait. This opening in the coastline provides an ideal route for the cool air flowing in off the ocean which drags the sea fog in with it.