Developments in the description of the masses of atomic nuclei have led to various nuclear mass models that provide predictions for masses across the whole chart of nuclides. These mass models play an important role in understanding the synthesis of heavy elements in the rapid neutron capture (r) process. However, it is still a challenging task to estimate the size of uncertainty associated with the predictions of each mass model. In this work, a method called ensemble Bayesian model averaging (EBMA) is introduced to quantify the uncertainty of one-neutron separation energies (S1n) which are directly relevant in the calculations of r-process observables. This Bayesian method provides a natural way to perform model averaging, selection, and uncertainty quantification, by combining the mass models as a mixture of normal distributions whose parameters are optimized against the experimental data, employing the Markov chain Monte Carlo method using the no-u-turn sampler. The EBMA model optimized with all the experimental S1n from the AME2003 nuclides are shown to provide reliable uncertainty estimates when tested with the new data in the AME2020.