Proportions of different phases (phase fraction) in the microstructures determine the quality of dual phase (DP) steel. So, calculation of phase fraction in the microstructures of steel samples is important for quality assurance. Manual calculation of phase fraction involves Le Pera etching of steel which is time consuming and dependent on operator efficiency. Calculation of phase fraction from Le Pera etched samples requires cumbersome manual observations. Nital etching is a faster alternative to Le Pera etching. However, due to lack of visually discriminative information, different phases cannot be identified manually from nital images. We propose a novel method for automatic calculation of phase fractions in steel microstructures from nital images using machine learning techniques. We show that regional contour patterns and local entropy (which cannot be evaluated manually) of regions of nital images are related to the formation process of the phases. We design a method that automatically evaluates regional contour patterns and local entropy from nital images of DP steel. Subsequently, we construct a random forest classifier that uses regional contour patterns and local entropy as features for classification of different phases. Our method is ~150 times faster than manual classification. Experiments show close to 90% accuracy in classification. © The Institution of Engineering and Technology 2018.