Background Tuberculosis is the first infection-related cause of death worldwide. Early diagnosis of paucibacillary tuberculosis represents a challenge, even with direct tissue examination. Digital pathology allows the digital analysis of tissues to identify microorganisms. We aim to develop a program to detect and quantify typical and atypical mycobacteria in paraffin-embedded Ziehl–Neelsen-stained tissues. Methods Program development: The building of the program, named Pat-Scan, included pathology, systems engineering, and scientific applications. The iScan Coreo Au scanner® was used, and 9 variables were adjusted: Temp Directory Path, Output Directory Path, Server Path, Focus Approach, Focus Mode, AOI Detection Approach, Scan at, No. of Z Layers, and Z Delta. Software parameter settings : Brightness, contrast, sharpness, and red/green/blue. Control module scan and analysis : Ten Ziehl–Neelsen-stained samples were fragmented into 2,000 images and analyzed by a multidisciplinary team to validate the reproducibility of the bacilli images in the tissue, as detected by the software. Results Pat-Scan included software and a scanner that were used to detect and quantify bacilli in paraffin-embedded Ziehl–Neelsen-stained tissues. HD quality image segmentation was performed, and nine planes of the Z-axis were scanned with a 1-micron distance between planes. Image magnification: 40x–80x. Scan time: 10–12 minutes. All samples containing mycobacteria were successfully analyzed by the scanner, and the bacilli could be detected; these results were validated by expert pathologists by microscopy examination, and the presence of bacilli was confirmed in all cases. Conclusions Pat-Scan allowed the identification and quantification of mycobacteria in paraffin-embedded Ziehl–Neelsen-stained tissues, offering a reproducible diagnostic method that reduces the time for diagnosis and does not affect precision. Further validation is needed for application in the clinical setting.