A systematic decay of the aftershock rate over time is one of the most fundamental empirical laws in Earth science. However, the equally fundamental effect of a mainshock on the size distribution of subsequent earthquakes has still not been quantified today and is therefore not used in earthquake hazard assessment. We apply a stacking approach to well-recorded earthquake sequences to extract this effect. Immediately after a mainshock, the mean size distribution of events, or b value, increases by 20–30%, considerably decreasing the chance of subsequent larger events. This increase is strongest in the immediate vicinity of the mainshock, decreasing rapidly with distance but only gradually over time. We present a model that explains these observations as a consequence of the stress changes in the surrounding area caused by the mainshocks slip. Our results have substantial implications for how seismic risk during earthquake sequences is assessed.