We determine the charm quark mass mc(mc) from QCD sum rules of moments of the vector current correlator calculated in perturbative QCD. Only experimental data for the charm resonances below the continuum threshold are needed in our approach, while the continuum contribution is determined by requiring self-consistency between various sum rules, including the one for the zeroth moment. Existing data from the continuum region can then be used to bound the theoretical error. Our result is mc(mc)=1272±8 MeV for αs(MZ)=0.1182. Special attention is given to the question how to quantify and justify the uncertainty.