We describe a code to determine the initial and present mass of a star in the HR diagram. The code is based on an interpolation procedure between the two adjacent evolutionary tracks where the star is situated according to its luminosity and temperature (from Mv and CI). With a few modifications the code may be used with any set of evolutionary tracks. The mass obtained from the present position of the star in the HR diagram, may be rather ambiguous considering that it can be positioned in any of all the possible loops predicted by the theory of the evolution. Our code takes into account all possible solutions.