  Rational counterterms are a key ingredient for the automation of loop
calculations through numerical methods. Building on the recently established
properties of rational terms of UV origin at two loops, in this paper we
present a systematic method for the determination of rational counterterms
within spontaneously broken theories. In particular we introduce a generalised
vev-expansion approach that makes it possible to obtain the rational
counterterms of UV origin for a spontaneously broken theory by means of
calculations in the unbroken phase. The drastic simplifications that result
from the underlying symmetry open the door to the efficient determination of
rational counterterms for the full Standard Model at two loops. The
renormalisation-scheme dependence is analysed in detail, and we show that
rational counterterms need to be determined only once and for all in a generic
renormalisation scheme for the symmetric phase and, a posteriori, they can be
easily adapted to a wide range of physical renormalisation schemes for the
spontaneously broken phase. As a first application we determine the full set of
$\mathcal{O}(\alpha_{\mathrm s}^2)$ rational counterterms of UV origin for the
full Standard Model, i.e. for all superficially UV-divergent two-loop vertex
functions involving combinations of gluons, quarks, electroweak vector bosons
and scalar bosons.
