The Polarity Inversion Line (PIL) on the active region (AR) is a parameter that correlates with the occurrence of the solar flare. This research has developed application to extract the PIL length in the AR. Image processing techniques were used to detect and classify AR from the SDO/HMI Magnetogram image of 1024x1024 pixels. The detection of AR in magnetogram images has its challenges because the ARs are constructed by the white (black) regions represent the magnetic positive (negative) polarities. To improve detection accuracy, the application used The Solar Region Summary (SRS), compiled by SWPC, and the centroid position of sunspot on SDO/HMI Continuum as additional information. The results of AR detection had high accuracy because SRS stores the centroid position of the flaring active region at peak time with the Stonyhurst heliographic on the solar disk which is converted to Cartesian coordinates. The application test used 1450 images and obtained the PIL length on the peak time of the X-class and M-class flares from 2011-2017. The application detected the high distribution of PIL length in the range of 120 to 580 Mm for X class flare, and 120 to 390 Mm for M-class flare. This research provides new data that has the potential to improve the machine learning-based solar flare prediction models.