A method for estimating the mass of a vehicle, the vehicle comprising a plurality of sensors each configured to detect at least one quantity depending on an operating condition of the vehicle and a processing unit configured to receive electrical signals from the plurality of sensors, the method including: • detecting, by the plurality of sensors, a plurality of quantities comprising quantities which are a function of the angle of inclination (θ), the longitudinal speed (v), the longitudinal acceleration (a) and the drive torque (T em) of the vehicle; • providing, from the plurality of sensors, electrical signals depending on the plurality of quantities, to the processing unit; • processing, by the processing unit, the electrical signals as a function of the plurality of quantities, to determine a cost function (C(m)) associated with a dynamic equation of longitudinal equilibrium of the vehicle, the cost function being a function of the mass of the vehicle; • executing, by the processing unit, a minimization algorithm of the cost function; and • determining the mass of the vehicle resulting from the minimization algorithm, wherein the cost function is given by the difference between a first and a second function (F(m), G), the first function (F(m)) comprising a known portion (Φ) and being given by the sum of a first group of terms and the second function being given by the sum of a second group of terms, the first group of terms being a function of the mass of the vehicle and wherein the cost function minimization algorithm is performed iteratively, wherein the electrical signals also comprise a braking signal and wherein, before executing the cost function minimization algorithm, an algorithm trigger condition including checking if the vehicle is braking is verified, the algorithm trigger condition being satisfied if the braking signal indicates that the vehicle is not braking. the vehicle comprising a plurality of sensors each configured to detect at least one quantity depending on an operating condition of the vehicle and a processing unit configured to receive electrical signals from the plurality of sensors, the method including: • detecting, by the plurality of sensors, a plurality of quantities comprising quantities which are a function of the angle of inclination (θ), the longitudinal speed (v), the longitudinal acceleration (a) and the drive torque (T em) of the vehicle; • providing, from the plurality of sensors, electrical signals depending on the plurality of quantities, to the processing unit; • processing, by the processing unit, the electrical signals as a function of the plurality of quantities, to determine a cost function (C(m)) associated with a dynamic equation of longitudinal equilibrium of the vehicle, the cost function being a function of the mass of the vehicle; • executing, by the processing unit, a minimization algorithm of the cost function; and • determining the mass of the vehicle resulting from the minimization algorithm, • detecting, by the plurality of sensors, a plurality of quantities comprising quantities which are a function of the angle of inclination (θ), the longitudinal speed (v), the longitudinal acceleration (a) and the drive torque (T em) of the vehicle; • providing, from the plurality of sensors, electrical signals depending on the plurality of quantities, to the processing unit; • processing, by the processing unit, the electrical signals as a function of the plurality of quantities, to determine a cost function (C(m)) associated with a dynamic equation of longitudinal equilibrium of the vehicle, the cost function being a function of the mass of the vehicle; • executing, by the processing unit, a minimization algorithm of the cost function; and • determining the mass of the vehicle resulting from the minimization algorithm, wherein the cost function is given by the difference between a first and a second function (F(m), G), the first function (F(m)) comprising a known portion (Φ) and being given by the sum of a first group of terms and the second function being given by the sum of a second group of terms, the first group of terms being a function of the mass of the vehicle and wherein the cost function minimization algorithm is performed iteratively, wherein the electrical signals also comprise a braking signal and wherein, before executing the cost function minimization algorithm, an algorithm trigger condition including checking if the vehicle is braking is verified, the algorithm trigger condition being satisfied if the braking signal indicates that the vehicle is not braking.