  We compute the power spectrum of curvature perturbations in stochastic
inflation. This combines the distribution of first crossing times through the
end-of-inflation surface, which has been previously studied, with the
distribution of the fields value at the time when a given scale crosses out the
Hubble radius during inflation, which we show how to compute. This allows the
stochastic-$\delta N$ formalism to make concrete contact with observations. As
an application, we study how quantum diffusion at small scales (arising e.g. in
models leading to primordial black holes) affects the large-scale perturbations
observed in the cosmic microwave background. We find that even if those sets of
scales are well separated, large effects can arise from the distortion of the
classical relationship between field values and wavenumbers brought about by
quantum diffusion near the end of inflation. This shows that cosmic microwave
background measurements can set explicit constraints on the entire inflationary
potential down to the end of inflation.
