We address the contribution of the $3pi$ channel to hadronic vacuum polarization (HVP) using a dispersive representation of the $e^+e^-to 3pi$ amplitude. This channel gives the second-largest individual contribution to the total HVP integral in the anomalous magnetic moment of the muon $(g-2)_mu$, both to its absolute value and uncertainty. It is largely dominated by the narrow resonances $omega$ and $phi$, but not to the extent that the off-peak regions were negligible, so that at the level of accuracy relevant for $(g-2)_mu$ an analysis of the available data as model independent as possible becomes critical. Here, we provide such an analysis based on a global fit function using analyticity and unitarity of the underlying $gamma^*to3pi$ amplitude and its normalization from a chiral low-energy theorem, which, in particular, allows us to check the internal consistency of the various $e^+e^-to 3pi$ data sets. Overall, we obtain $a_mu^{3pi}|_{leq 1.8,text{GeV}}=46.2(6)(6)times 10^{-10}$ as our best estimate for the total $3pi$ contribution consistent with all (low-energy) constraints from QCD. In combination with a recent dispersive analysis imposing the same constraints on the $2pi$ channel below $1,text{GeV}$, this covers nearly $80%$ of the total HVP contribution, leading to $a_mu^text{HVP}=692.3(3.3)times 10^{-10}$ when the remainder is taken from the literature, and thus reaffirming the $(g-2)_mu$ anomaly at the level of at least $3.4sigma$. As side products, we find for the vacuum-polarization-subtracted masses $M_omega=782.63(3)(1),text{MeV}$ and $M_phi=1019.20(2)(1),text{MeV}$, confirming the tension to the $omega$ mass as extracted from the $2pi$ channel.