We perform a detailed analysis of $e^+e^-\to\pi^+\pi^-$ data for energies below $1\,\text{GeV}$, based on a dispersive representation of the pion vector form factor. Using an extended Omnès representation and input for the $\pi\pi$ $P$-wave phase shift from a previous Roy-equation analysis, we express the pion vector form factor in terms of a few free parameters, which are fit to the modern high-statistics data sets. Statistically acceptable fits are obtained as soon as potential uncertainties in the energy calibration are taken into account. The fits prefer a mass of the $\omega$ meson significantly lower than the current PDG average. We perform a complete analysis of statistical and systematic uncertainties and derive the consequences for the two-pion contribution to hadronic vacuum polarization and the muon anomalous magnetic moment $a_\mu$. In a global fit, we find $a_\mu^{\pi\pi}|_{\leq 1\,\text{GeV}}=495.0(1.5)(2.1)\times 10^{-10}$ and $a_\mu^{\pi\pi}|_{\leq 0.63\,\text{GeV}}=132.8(0.4)(1.0)\times 10^{-10}$. As side products, we obtain improved constraints on the $\pi\pi$ $P$-wave as well as a determination of the pion charge radius, $\langle r_\pi^2 \rangle = 0.429(1)(4)\,\text{fm}^2$.