Fog is a collection of water droplets or ice crystals suspended in the air at or near the Earth's surface. While fog is a type of a cloud, the term "fog" is typically distinguished from the more generic term "cloud" in that fog is low-lying, and the moisture in the fog is often generated locally (such as from a nearby body of water, like a lake or the ocean, or from nearby moist ground or marshes).
Fog forms when the difference between temperature and dew point is generally less than 2.5 °C or 4 F.
Fog begins to form when water vapor condenses into tiny liquid water droplets in the air. The main ways water vapor is added to the air: wind convergence into areas of upward motion, precipitation or virga falling from above, daytime heating evaporating water from the surface of oceans, water bodies or wet land, transpiration from plants, cool or dry air moving over warmer water, and lifting air over mountains. Water vapor normally begins to condense on condensation nuclei such as dust, ice, and salt in order to form clouds. Fog, like its slightly elevated cousin stratus, is a stable cloud deck which tends to form when a cool, stable air mass is trapped underneath a warm air mass.
Fog normally occurs at a relative humidity near 100%. This can be achieved by either adding moisture to the air or dropping the ambient air temperature. Fog can form at lower humidities, and fog can sometimes not form with relative humidity at 100%. A reading of 100% relative humidity means that the air can hold no additional moisture; the air will become supersaturated if additional moisture is added.
Fog can form suddenly, and can dissipate just as rapidly, depending what side of the dew point the temperature is on. This phenomenon is known as flash fog.
Another common type of formation is associated with sea fog (also known as haar or fret). This is due to the peculiar effect of salt. Clouds of all types require minute hygroscopic particles upon which water vapor can condense. Over the ocean surface, the most common particles are salt from salt spray produced by breaking waves. Except in areas of storminess, the most common areas of breaking waves are located near coastlines, hence the greatest densities of airborne salt particles are there. Condensation on salt particles has been observed to occur at humidities as low as 70%, thus fog can occur even in relatively dry air in suitable locations such as the California coast. Typically, such lower humidity fog is preceded by a transparent mistiness along the coastline as condensation competes with evaporation, a phenomenon that is typically noticeable by beachgoers in the afternoon. Another recently-discovered source of condensation nuclei for coastal fog is kelp. Researchers have found that under stress (intense sunlight, strong evaporation, etc.), kelp release particles of iodine which in turn become nuclei for condensation of water vapor.
Fog occasionally produces precipitation in the form of drizzle or very light snow. Drizzle occurs when the humidity of fog attains 100% and the minute cloud droplets begin to coalesce into larger droplets. This can occur when the fog layer is lifted and cooled sufficiently, or when it is forcibly compressed from above. Drizzle becomes freezing drizzle when the temperature at the surface drops below the freezing point.
The thickness of fog is largely determined by the altitude of the inversion boundary, which in coastal or oceanic locales is also the top of the marine layer, above which the airmass is warmer and drier. The inversion boundary varies its altitude primarily in response to the weight of the air above it which is measured in terms of atmospheric pressure. The marine layer and any fogbank it may contain will be "squashed" when the pressure is high, and conversely, may expand upwards when the pressure above it is lowering.