Near-field nanophotonics offers the promise of orders-of-magnitude enhancements for phenomena ranging from spontaneous-emission engineering to Casimir forces via zero-point quantum fluctuations. An increasing variety of approaches — photonic crystals, metamaterials, metasurfaces, antennas, and more — has underscored our lack of understanding as to how large these effects can be. We provide a general answer to this question, deriving the first sum rule for near-field optical response as well as general upper bounds for any bandwidth, i.e. power–bandwidth limits. Within such a unified framework valid for structures of arbitrary shape and size, we approach single-frequency limits as bandwidth goes to zero and the sum rule as bandwidth goes to infinity. Power–bandwidth limits are derived from energy-conservation principles and depend on the susceptibility at the frequency of interest, and the sum rule arises from the requirement of causality and only depends on susceptibility at zero frequency. We explore to what extent power–bandwidth bounds can be attained for real materials and how the sum rule can be realized for canonical geometries. We further prove a "monotonicity" theorem that enables us to bound the integrated frequency response of any complicated structure in terms of the response of simple geometries. Our framework provides a universal measure of intrinsic optical-response characteristics that helps identify optimal nanophotonic materials for any combination of frequency and bandwidth, leading to wide-ranging applications in medical imaging and thermophotovoltaics.