  The electromagnetic form factors of charged and neutral kaons are strongly
constrained by their low-energy singularities, in the isovector part from
two-pion intermediate states and in the isoscalar contribution in terms of
$\omega$ and $\phi$ residues. The former can be predicted using the respective
$\pi\pi\to\bar K K$ partial-wave amplitude and the pion electromagnetic form
factor, while the latter parameters need to be determined from electromagnetic
reactions involving kaons. We present a global analysis of time- and spacelike
data that implements all of these constraints. The results enable manifold
applications: kaon charge radii, elastic contributions to the kaon
electromagnetic self energies and corrections to Dashen's theorem, kaon boxes
in hadronic light-by-light (HLbL) scattering, and the $\phi$ region in hadronic
vacuum polarization (HVP). Our main results are: $\langle
r^2\rangle_\text{c}=0.359(3)\,\text{fm}^2$, $\langle
r^2\rangle_\text{n}=-0.060(4)\,\text{fm}^2$ for the charged and neutral radii,
$\epsilon=0.63(40)$ for the elastic contribution to the violation of Dashen's
theorem, $a_\mu^{K\text{-box}}=-0.48(1)\times 10^{-11}$ for the charged kaon
box in HLbL scattering, and $a_\mu^\text{HVP}[K^+K^-, \leq
1.05\,\text{GeV}]=184.5(2.0)\times 10^{-11}$, $a_\mu^\text{HVP}[K_SK_L, \leq
1.05\,\text{GeV}]=118.3(1.5)\times 10^{-11}$ for the HVP integrals around the
$\phi$ resonance. The global fit to $\bar K K$ gives $\bar
M_\phi=1019.479(5)\,\text{MeV}$, $\bar \Gamma_\phi=4.207(8)\,\text{MeV}$ for
the $\phi$ resonance parameters including vacuum-polarization effects.
