We study the convolution function $$ C[f(x)]:=\int_1^x f(y)f\Bigl(\frac xy\Bigr)\frac{dy}y $$ when $f(x)$ is a suitable number-theoretic error term. Asymptotics and upper bounds for $C[f(x)]$ are derived from mean square bounds for $f(x)$. Some applications are given, in particular to $|\zeta(\tfrac12+ix)|^{2k}$ and the classical Rankin--Selberg problem from analytic number theory.