Method for estimating the capacity of an electric battery , implemented by an electronic device for managing the battery, comprising the following steps: a) during a battery charging and/or discharging phase, selecting a plurality of measurement periods and, for each period, measuring the charge variation ΔQ and estimating the variation of state of charge ΔSOC of the battery between the beginning and the end of the measurement period; and b) estimating the capacity of the battery by means of a Kalman filter from the values ΔQ and ΔSOC determined in step a), characterized in that step b) further comprises a step of determining or approaching the ordinate at the origin (b0) of a straight line approximating a cloud of points defined by the set of pairs of values ΔQ, ΔSOC acquired in step a), step b) further comprising a step 203-3 of selecting, in the cloud of points , a subset of points which satisfy a consensus criterion or criterion for rejecting outliers, said subset of points being determined by a consensus method of single-sample random selection comprising N hyp successive iterations of the sequence of following steps, where N hyp is an integer greater than or equal to 2: 203-3a) randomly selecting a single point not already selected in the cloud of points; 203-3b) determining a straight line passing through the point selected in step 203-3a), and through the determined or approached ordinate at the origin (b0); and 203-c) determining the points of the cloud which satisfy the consensus criterion with respect to the line determined in step 203-3b), and step b) further comprising a step 203-4 of updating the Kalman filter from the subset of points selected in step 203-3. a) during a battery charging and/or discharging phase, selecting a plurality of measurement periods and, for each period, measuring the charge variation ΔQ and estimating the variation of state of charge ΔSOC of the battery between the beginning and the end of the measurement period; and b) estimating the capacity of the battery by means of a Kalman filter from the values ΔQ and ΔSOC determined in step a), characterized in that step b) further comprises a step of determining or approaching the ordinate at the origin (b0) of a straight line approximating a cloud of points defined by the set of pairs of values ΔQ, ΔSOC acquired in step a), step b) further comprising a step 203-3 of selecting, in the cloud of points , a subset of points which satisfy a consensus criterion or criterion for rejecting outliers, said subset of points being determined by a consensus method of single-sample random selection comprising N hyp successive iterations of the sequence of following steps, where N hyp is an integer greater than or equal to 2: 203-3a) randomly selecting a single point not already selected in the cloud of points; 203-3b) determining a straight line passing through the point selected in step 203-3a), and through the determined or approached ordinate at the origin (b0); and 203-c) determining the points of the cloud which satisfy the consensus criterion with respect to the line determined in step 203-3b), and 203-3a) randomly selecting a single point not already selected in the cloud of points; 203-3b) determining a straight line passing through the point selected in step 203-3a), and through the determined or approached ordinate at the origin (b0); and 203-c) determining the points of the cloud which satisfy the consensus criterion with respect to the line determined in step 203-3b), and step b) further comprising a step 203-4 of updating the Kalman filter from the subset of points selected in step 203-3. <EOS>