ABSTRACT Melasma is a common pigmentary disorder accompanied by tissue changes in composition and structure through the epidermis and dermis. In this study, we propose to employ optical coherence tomography (OCT) combined with deep learning techniques for melasma diagnostics. Specifically, a portable spectral domain OCT system with a handheld probe was developed for clinical skin imaging. Then, a diagnostic model was built based on the VGG16 neural network by adding a spatial attention mechanism. The results show that a good differentiation with an accuracy of 94.2% can be achieved among health datasets from healthy volunteers, and melasma and tissue‐around‐melasma datasets from melasma patients. Moreover, the same trained model was applied to treatment evaluation, showing a good capability to assess antivascular medicine treatment. Thus, it can be concluded that OCT combined with deep learning techniques has a good potential to aid in clinical diagnosis and treatment evaluation of melasma.