In an electronic device powered by a battery, a method of determining a charge of the battery. Initially, a discharge curve specifying the battery's voltage as a function of time is determined. This discharge curve is calibrated according to actual measurements. Next, a battery state model is established. The battery state model is comprised of a number of discrete charge states. The probability of the actual battery's charge for a particular charge state is specified by the battery state model for each of the charge states. The battery's voltage is periodically measured. Based on the measured voltage and the discharge curve, a voltage probability distribution is computed. The battery discharge model is updated by applying Bayes theorem to the old discharge model and the voltage probability distribution. The charge of the battery based on a mean value of the battery discharge model is then displayed.