Recently, the miniaturized multiphoton microscopy (MPM) and multiphoton probe allow the clinical use of multiphoton endoscopy for diagnosing cancer via "optical biopsy". The purpose of this study was to establish MPM optical diagnostic features for liver cancer and evaluate the sensitivity, specificity, and accuracy of MPM optical diagnosis. Firstly, we performed a pilot study to establish the MPM diagnostic features by investigating 60 surgical specimens, and found that high-resolution MPM images clearly demonstrated apparent differences between benign and malignant liver lesions in terms of their tissue architecture and cell morphology. Cancer cells, characterized by irregular size and shape, enlarged nuclei, and increased nuclear-cytoplasmic ratio, were identified by MPM images, which were comparable to hematoxylin-eosin staining images. Secondly, we performed a blinded study to evaluate the sensitivity, specificity, and accuracy of MPM optical diagnosis by investigating another 164 specimens, and found that the sensitivity, specificity, and accuracy of MPM diagnosis was 96.32%, 96.43%, and 96.34%, respectively. In conclusion, it is feasible to use MPM to diagnose liver cancer and differentiate benign and malignant liver lesions. This preclinical study provides the groundwork for further using multiphoton endoscopy to perform real-time noninvasive "optical biopsy" for liver lesions in the near future.