A synthesis of long-term changes in pH of coastal ecosystems shows that, in contrast to the uniform trends of open-ocean acidification (-0.0004 to -0.0026 pH units yr-1) driven by increased atmospheric CO2, coastal ecosystems display a much broader range of trends (-0.023 to 0.023 pH units yr-1) and are as likely to show long-term increase as decline in pH. The majority of the 83 investigated coastal ecosystems displayed nonlinear trends, with seasonal and interannual variations exceeding 1 pH unit for some sites. The high pH variability of coastal ecosystems is primarily driven by inputs from land. These include freshwater inputs that typically dilute the alkalinity of seawater thereby resulting in reduced buffering, nutrients enhancing productivity and pH, as well as organic matter supporting excess respiration driving acidification. For some coastal ecosystems, upwelling of nutrient-rich and corrosive water may also contribute to variability in pH. Metabolic control of pH was the main factor governing variability for the majority of coastal sites, displaying larger variations in coastal ecosystems with low alkalinity buffering. pH variability was particularly pronounced in coastal ecosystems with strong decoupling of production and respiration processes, seasonally or through stratification. Our analysis demonstrate that coastal pH can be managed by controlling inputs of nutrients, organic matter, and alkalinity. In well-mixed coastal waters, increasing productivity can improve resistance to ocean acidification, whereas increasing productivity enhances acidification in bottom waters of stratified coastal ecosystems. Environmental management should consider the balance between the negative consequences of eutrophication versus those of acidification, to maintain biodiversity and ecosystem services of our coastal ecosystems.