  We study the ${\text{2HDM}}$ contribution to the muon anomalous magnetic
moment $a_\mu$ and present the complete two-loop result, particularly for the
bosonic contribution. We focus on the Aligned ${\text{2HDM}}$, which has
general Yukawa couplings and contains the type I, II, X, Y models as special
cases. The result is expressed with physical parameters: three Higgs boson
masses, Yukawa couplings, two mixing angles, and one quartic potential
parameter. We show that the result can be split into several parts, each of
which has a simple parameter dependence, and we document their general
behavior. Taking into account constraints on parameters, we find that the full
${\text{2HDM}}$ contribution to $a_\mu$ can accommodate the current
experimental value, and the complete two-loop bosonic contribution can amount
to $(2\cdots 4)\times 10^{-10}$, more than the future experimental uncertainty.
