ABSTRACT Despite increasingly precise observations and sophisticated theoretical models, the discrepancy between measurements of H0 from the cosmic microwave background or from baryon acoustic oscillations combined with big bang nucleosynthesis versus those from local distance ladder probes – commonly known as the ‘H0 tension’ – continues to perplex the scientific community. To address this tension, early dark energy (EDE) models have been proposed as alternatives to Lambda cold dark matter, as they can change the observed sound horizon and the inferred Hubble constant from measurements based on this. In this paper, we investigate the use of Bayesian model averaging (BMA) to evaluate EDE as a solution to the H0 tension. BMA consists of assigning a prior to the model and deriving a posterior as for any other unknown parameter in a Bayesian analysis. BMA can be computationally challenging in that one must approximate the joint posterior of both model and parameters. Here, we present a computational strategy for BMA that exploits existing Markov chain Monte Carlo software and combines model-specific posteriors post hoc. In application to a comprehensive analysis of cosmological data sets, we quantify the impact of EDE on the H0 discrepancy. We find an EDE model probability of ${\sim} 90~{{\ \rm per\ cent}}$ whenever we include the H0 measurement from Type Ia supernovae in the analysis, whereas the other data show a strong preference for the standard cosmological model. We finally present constraints on common parameters marginalized over both cosmological models. For reasonable priors on models with and without EDE, the H0 tension is reduced by at least 20 per cent.